{"id":27395908,"url":"https://github.com/forwardsoftware/qrcodets","last_synced_at":"2025-04-13T23:28:21.922Z","repository":{"id":284618365,"uuid":"955520770","full_name":"forwardsoftware/qrcodets","owner":"forwardsoftware","description":"QR Code generator written in TypeScript","archived":false,"fork":false,"pushed_at":"2025-04-11T19:03:05.000Z","size":125,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-11T20:23:05.203Z","etag":null,"topics":["qr-code","qr-generator","qrcode","qrcode-generator"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@forward-software/qrcodets","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"lilRedaka/qrcodets","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/forwardsoftware.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-26T19:11:46.000Z","updated_at":"2025-04-11T19:03:07.000Z","dependencies_parsed_at":"2025-04-11T20:22:50.277Z","dependency_job_id":"32a2bc5b-e47e-4376-9744-829af8033705","html_url":"https://github.com/forwardsoftware/qrcodets","commit_stats":null,"previous_names":["forwardsoftware/qrcodets"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forwardsoftware%2Fqrcodets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forwardsoftware%2Fqrcodets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forwardsoftware%2Fqrcodets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forwardsoftware%2Fqrcodets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forwardsoftware","download_url":"https://codeload.github.com/forwardsoftware/qrcodets/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248795688,"owners_count":21162822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["qr-code","qr-generator","qrcode","qrcode-generator"],"created_at":"2025-04-13T23:28:21.060Z","updated_at":"2025-04-13T23:28:21.906Z","avatar_url":"https://github.com/forwardsoftware.png","language":"TypeScript","readme":"# QRCodeTS\n\n\u003e QRCodeTS is a TypeScript re-implementation and packaging of the original [QRCodeJS](https://github.com/davidshimjs/qrcodejs) library.\n\u003e\n\u003e It allows you to generate QR codes with various customizable options.\n\n## Installation\n\nTo install the package:\n\n```bash\nnpm i @forward-software/qrcodets\n```\n\n## Usage\n\nYou can import and use QRCodeTS in your project as follows\n\n### Render using HTML API (DOM or Canvas)\n\n```javascript\nimport { QRCode, HTMLRenderer as HTML } from \"@forward-software/qrcodets\";\n\nnew QRCode(\"https://example.com\", {\n  type: 4,\n  correctionLevel: \"H\",\n  size: 256,\n  colorDark: \"#000000\",\n  colorLight: \"#ffffff\",\n}).renderTo(HTML(document.getElementById(\"qrcode\")));\n\n```\n\n### Render using an SVG\n\n```javascript\nimport { QRCode, SVGRenderer as SVG } from \"@forward-software/qrcodets\";\n\nnew QRCode(\"https://example.com\", {\n  type: 4,\n  correctionLevel: \"H\",\n  size: 256,\n  colorDark: \"#000000\",\n  colorLight: \"#ffffff\",\n}).renderTo(SVG(document.getElementById(\"qrcode\")));\n\n```\n\n### Fluent API\n\n```javascript\nimport { QRCode, HTMLRenderer as HTML } from \"@forward-software/qrcodets\";\n\nQRCode.from(\"https://example.com\")\n  .withOptions({ correctionLevel: \"H\", size: 256 })\n  .renderTo(HTML(document.getElementById(\"qrcode\")));\n\n```\n\n### Options\n\n| Name              | Type                                                      | Description                                                                                                                                                                                                 | Default     |\n| ----------------- | --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |\n| `size`            | Number                                                    | The physical size of the QR Code in pixels.                                                                                                                                                                 | `256`       |\n| `colorDark`       | String                                                    | The color of the dark modules (QR Code pixels).\u003cbr/\u003eAccepts any valid CSS color string.                                                                                                                     | `\"#000000\"` |\n| `colorLight`      | String                                                    | The color of the light modules (background).\u003cbr/\u003eAccepts any valid CSS color string.                                                                                                                        | `\"#ffffff\"` |\n| `type`            | Number                                                    | The QR Code version/type number (1-40).\u003cbr/\u003e\u003cbr/\u003eHigher values increase the size and data capacity of the QR Code.\u003cbr/\u003e\u003cbr/\u003e**NOTE:** If not set, the library will try to compute it based on content size. | `undefined` |\n| `correctionLevel` | [QRCodeErrorCorrectionLevel](#qrcodeerrorcorrectionlevel) | The error correction level of the QR Code.                                                                                                                                                                  | `\"H\"`       |\n\n\n#### QRCodeErrorCorrectionLevel\n\nThe error correction level of a QR Code\n\n| Value | Description                       |\n| ----- | --------------------------------- |\n| `\"L\"` | (Low): ~7% error correction       |\n| `\"M\"` | (Medium): ~15% error correction   |\n| `\"Q\"` | (Quartile): ~25% error correction |\n| `\"H\"` | (High): ~30% error correction     |\n\n\n\n## Migrating from QRCodeTS by lilRedaka?\n\nYou can replace [QRCodeTS](https://github.com/lilRedaka/qrcodets) by [lilRedaka](https://github.com/lilRedaka) and keep using the same code as before by importing and using the `QRCodeCompat` compatibility class in your project.\n\n```javascript\nimport { QRCodeCompat as QRCode, QRErrorCorrectLevel } from \"@forward-software/qrcodets\";\n\nconst params = {\n  id: \"qrcode\",\n  element: document.getElementById(\"qrcode\"),\n  width: 256,\n  height: 256,\n  typeNumber: 4,\n  colorDark: \"#000000\",\n  colorLight: \"#ffffff\",\n  correctLevel: QRErrorCorrectLevel.H,\n  text: \"https://example.com\",\n  mode: \"svg\",\n};\n\nconst qrCode = new QRCode(params);\n```\n\n#### Initialization Parameters\n\nThe QRCode class takes an object with the following properties as initialization parameters:\n\n- id (optional): string\n  - The ID of the HTML element where the QR code will be rendered.\n- element (optional): HTMLElement\n  - The HTML element where the QR code will be rendered. If both id and element are provided, element will be used.\n- width (optional): number\n  - The width of the QR code.\n- height (optional): number\n  - The height of the QR code.\n- typeNumber (optional): number\n  - The QR code version (1-40). Higher values increase the size and data capacity of the QR code.\n- colorDark: string\n  - The color of the dark modules (QR code pixels).\n- colorLight: string\n  - The color of the light modules (background).\n- correctLevel (optional): QRErrorCorrectLevel\n  - The error correction level. Possible values are:\n    - QRErrorCorrectLevel.L (Low - ~7% error correction)\n    - QRErrorCorrectLevel.M (Medium - ~15% error correction)\n    - QRErrorCorrectLevel.Q (Quartile - ~25% error correction)\n    - QRErrorCorrectLevel.H (High - ~30% error correction)\n- text (optional): string\n  - The text or URL to be encoded in the QR code.\n- mode (optional): \"svg\" | \"dom\"\n  - The rendering mode. Either 'svg' for SVG rendering or 'dom' for HTML DOM rendering.\n\n## License\n\nMIT License\n\n## Acknowledgments\n\nThis library is based on [QRCodeTS](https://github.com/lilRedaka/qrcodets) by [lilRedaka](https://github.com/lilRedaka) and the original [QRCodeJS](https://github.com/davidshimjs/qrcodejs) by [davidshimjs](https://github.com/davidshimjs).\n\n---\n\nMade with ✨ \u0026 ❤️ by [ForWarD Software](https://github.com/forwardsoftware) and [contributors](https://github.com/forwardsoftware/qrcodets/graphs/contributors)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforwardsoftware%2Fqrcodets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforwardsoftware%2Fqrcodets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforwardsoftware%2Fqrcodets/lists"}