{"id":15408938,"url":"https://github.com/sec-ant/ansi-qr-code","last_synced_at":"2025-03-28T02:45:59.993Z","repository":{"id":189880057,"uuid":"681504706","full_name":"Sec-ant/ansi-qr-code","owner":"Sec-ant","description":"Make Qr Codes suited for the terminal","archived":false,"fork":false,"pushed_at":"2023-08-24T09:46:35.000Z","size":218,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T04:14:54.813Z","etag":null,"topics":["ansi-qr-code","lib","qr-code","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@sec-ant/ansi-qr-code/v/latest","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sec-ant.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2023-08-22T06:52:24.000Z","updated_at":"2024-10-05T20:47:28.000Z","dependencies_parsed_at":"2024-10-20T13:50:28.169Z","dependency_job_id":null,"html_url":"https://github.com/Sec-ant/ansi-qr-code","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"951cc2cf03264c0427ff08773c72872e3354d252"},"previous_names":["sec-ant/ansi-qr-code"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sec-ant%2Fansi-qr-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sec-ant%2Fansi-qr-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sec-ant%2Fansi-qr-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sec-ant%2Fansi-qr-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sec-ant","download_url":"https://codeload.github.com/Sec-ant/ansi-qr-code/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245960613,"owners_count":20700777,"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":["ansi-qr-code","lib","qr-code","typescript"],"created_at":"2024-10-01T16:36:02.756Z","updated_at":"2025-03-28T02:45:59.976Z","avatar_url":"https://github.com/Sec-ant.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @sec-ant/ansi-qr-code\n\nMake Qr Codes suited for the terminal. This package provides functions for creating both large and small QR codes, with customizable options such as error correction level, border size, module colors etc.\n\n![ansi-qr-code-demo](https://github.com/Sec-ant/ansi-qr-code/assets/10386119/b3c7aa16-c178-4722-adc3-6a6f9f7ce1f6)\n\n## Install\n\n```bash\nnpm i @sec-ant/ansi-qr-code\n```\n\n## Usage\n\nFirst, import the `makeAnsiQrCode` and/or `makeSmallAnsiQrCode` function(s) from the package.\n\n```typescript\nimport { makeAnsiQrCode, makeSmallAnsiQrCode } from \"@sec-ant/ansi-qr-code\";\n```\n\nYou can then generate a QR code by calling the function, passing your desired text along with optional configuration options.\n\n### Large QR Codes\n\nLarge QR Codes are generated by `makeAnsiQrCode` function. This function uses ideographic space (\"　\") to construct the Qr Code.\n\n```typescript\nconst ansiQrCode = makeAnsiQrCode(\"Hello, world!\", {\n  ecc: ECC.MEDIUM,\n  border: 1,\n  blackModuleColor: BG_BLUE,\n  whiteModuleColor: BG_BRIGHT_GREEN,\n});\n\nconsole.log(ansiQrCode.value);\n```\n\n#### Options (AnsiQrCodeOptions)\n\n- _ecc_: `Ecc` - Determines the error correction level. Can be one of `Ecc` enum values(`Ecc.LOW`, `Ecc.MEDIUM`, `Ecc.QUARTILE`, or `Ecc.HIGH`). Default is `Ecc.LOW`.\n- _border_: `number` - Specifies the border size. Default is `4`.\n- _blackModuleColor_: `BgColor | Reset` - Defines the ANSI color code for the black modules of the QR code. Default is `BG_BLACK`.\n- _whiteModuleColor_: `BgColor | Reset` - Defines the ANSI color code for the white modules of the QR code. Default is `BG_BRIGHT_WHITE`.\n\n### Small QR Codes\n\nSmall QR Codes are generated by `makeSmallAnsiQrCode` function. This function uses the combinations of block elements and space as _quadrublocks_ to construct the Qr Code.\n\n\u003cdiv align=\"center\"\u003e\n\n| quadrublocks | `00` | `01` | `10` | `11` |\n| :----------: | :--: | :--: | :--: | :--: |\n|   **`00`**   | `  ` | ` ▄` | `▄ ` | `▄▄` |\n|   **`01`**   | ` ▀` | ` █` | `▄▀` | `▄█` |\n|   **`10`**   | `▀ ` | `▀▄` | `█ ` | `█▄` |\n|   **`11`**   | `▀▀` | `▀█` | `█▀` | `██` |\n\n\u003c/div\u003e\n\n```typescript\nconst smallAnsiQrCode = makeSmallAnsiQrCode(\"Hello, world!\", {\n  ecc: ECC.MEDIUM,\n  border: 4,\n  blackModuleColor: FG_RED,\n  whiteModuleColor: RESET,\n});\n\nconsole.log(smallAnsiQrCode.value);\n```\n\n#### Options (SmallAnsiQrCodeOptions)\n\n- _ecc_: `Ecc` - Determines the error correction level. Can be one of `Ecc` enum values(`Ecc.LOW`, `Ecc.MEDIUM`, `Ecc.QUARTILE`, or `Ecc.HIGH`). Default is `Ecc.LOW`.\n- _border_: `number` - Specifies the border size. Default is `4`.\n- _blackModuleColor_: `FgColor | Reset` (Default style) or `BgColor | Reset` (Inverted style) - Defines the ANSI color code for the black modules of the QR code.\n- _whiteModuleColor_: `BgColor | Reset` (Default style) or `FgColor | Reset` (Inverted style) - Defines the ANSI color code for the white modules of the QR code.\n\n### Additional exports\n\nThe package also exports `ECC` (an Enum that determines the error correction level) and some additional ANSI terminal colors and escape codes like `RESET`, `BG_BLACK`, `BG_BRIGHT_WHITE`, and `FG_BLACK`. You can use these constants to set the module colors of your QR codes.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsec-ant%2Fansi-qr-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsec-ant%2Fansi-qr-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsec-ant%2Fansi-qr-code/lists"}