{"_id":"@ashaffah/barcodes","_rev":"5-f6b538f8b4073344df967f70d2bd17e0","name":"@ashaffah/barcodes","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.0":{"name":"@ashaffah/barcodes","version":"0.1.0","keywords":["barcode","qrcode","ean","ean13","upc","code128","code39","code93","codabar","itf","gs1","databar","pdf417","datamatrix","aztec","postal","imb","rm4scc","svg"],"author":{"name":"ashaffah"},"license":"MIT","_id":"@ashaffah/barcodes@0.1.0","maintainers":[{"name":"ashaffah","email":"wagamama.morph@gmail.com"}],"homepage":"https://github.com/ashaffah/ts-barcodes#readme","bugs":{"url":"https://github.com/ashaffah/ts-barcodes/issues"},"dist":{"shasum":"6e5e1b3f49915e07500fd895cababa89509ed90b","tarball":"https://registry.npmjs.org/@ashaffah/barcodes/-/barcodes-0.1.0.tgz","fileCount":7,"integrity":"sha512-CflFrWgy5U1NmdtWdkWnlf4n6tXVBCwxOiwXmaWJkpn2rsTgK9eOfX2eR+6OT165uh3eu6AEkomWh1bkG2nuXA==","signatures":[{"sig":"MEQCIFwNYivAnDOBlWtiAx9krPWTITdMnffnULL/ePsAeBLfAiBvvZpo15oajMcGDwpH7PMnqjponZFHUfz94qyR8lkErg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":276638},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"884f7dad98015523b1250d173a33b43e3e1cfc5f","scripts":{"build":"tsup src/index.ts --format esm,cjs --dts --clean","verify":"tsx scripts/gen.ts","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"ashaffah","email":"wagamama.morph@gmail.com"},"repository":{"url":"git+https://github.com/ashaffah/ts-barcodes.git","type":"git"},"_npmVersion":"11.11.1","description":"Universal bar/QR code generation library for TypeScript & JavaScript — zero dependencies, works in browser, Node and Deno.","directories":{},"sideEffects":false,"_nodeVersion":"25.8.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.3.5","typescript":"^5.7.2","@types/node":"^22.10.0"},"_npmOperationalInternal":{"tmp":"tmp/barcodes_0.1.0_1783910170317_0.12759315106934932","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@ashaffah/barcodes","version":"0.1.1","keywords":["barcode","qrcode","ean","ean13","upc","code128","code39","code93","codabar","itf","gs1","databar","pdf417","datamatrix","aztec","postal","imb","rm4scc","svg"],"author":{"name":"ashaffah"},"license":"MIT","_id":"@ashaffah/barcodes@0.1.1","maintainers":[{"name":"ashaffah","email":"wagamama.morph@gmail.com"}],"homepage":"https://github.com/ashaffah/ts-barcodes#readme","bugs":{"url":"https://github.com/ashaffah/ts-barcodes/issues"},"dist":{"shasum":"b62a460afa56df9f5b6c97a737e728e7249416ce","tarball":"https://registry.npmjs.org/@ashaffah/barcodes/-/barcodes-0.1.1.tgz","fileCount":7,"integrity":"sha512-UnMNGZWHYEnqrzOjzKZEMtY3HfV+iptuY5f+uCWnWiz+7BDnE0XbvCeWzJr1L+XyWhpNe3TrNuyAYMmvfwZsmQ==","signatures":[{"sig":"MEQCIEd6Bao3oA1I/ggsCOpOgdQwUYCl9ukeH0pewak1aplhAiBrXb7LE8WL5e/erAYsssG+qSIeXV5ySkyr/vMUkureug==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":276877},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"65d34b5e54b827898313f911a56550e5cc506ca7","scripts":{"build":"tsup src/index.ts --format esm,cjs --dts --clean","verify":"tsx scripts/gen.ts","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"ashaffah","email":"wagamama.morph@gmail.com"},"repository":{"url":"git+https://github.com/ashaffah/ts-barcodes.git","type":"git"},"_npmVersion":"11.11.1","description":"Universal bar/QR code generation library for TypeScript & JavaScript — zero dependencies, works in browser, Node and Deno.","directories":{},"sideEffects":false,"_nodeVersion":"25.8.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.3.5","typescript":"^5.7.2","@types/node":"^22.10.0"},"_npmOperationalInternal":{"tmp":"tmp/barcodes_0.1.1_1784754761325_0.5283164878642046","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@ashaffah/barcodes","version":"0.1.2","keywords":["barcode","qrcode","ean","ean13","upc","code128","code39","code93","codabar","itf","gs1","databar","pdf417","datamatrix","aztec","postal","imb","rm4scc","svg"],"author":{"name":"ashaffah"},"license":"MIT","_id":"@ashaffah/barcodes@0.1.2","maintainers":[{"name":"ashaffah","email":"wagamama.morph@gmail.com"}],"homepage":"https://github.com/ashaffah/ts-barcodes#readme","bugs":{"url":"https://github.com/ashaffah/ts-barcodes/issues"},"dist":{"shasum":"40bd5e1ecefbd3baab5d6094fe347a3110ffdfb3","tarball":"https://registry.npmjs.org/@ashaffah/barcodes/-/barcodes-0.1.2.tgz","fileCount":7,"integrity":"sha512-ZOGmLtobxcUthRuhnK6DTCdNXug9K/S4Cq/7ClhGpYPLPqCjM6iwOmM4LRszs5uR9Ea6p/qvg2S7fnuoMIkmLQ==","signatures":[{"sig":"MEUCIAaGlpJ49DamChSmIrZnFEheV2yTmcbNRcDwvEOMmO7hAiEAgfVIf9SK+Wp5RuqOLaMOl0ntFk7gNSm0sqRIDvUQpHA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":276720},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"117f3309ae40309b16205283cabb5cf64ea0d7a1","scripts":{"build":"tsup src/index.ts --format esm,cjs --dts --clean","verify":"tsx scripts/gen.ts","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"ashaffah","email":"wagamama.morph@gmail.com"},"repository":{"url":"git+https://github.com/ashaffah/ts-barcodes.git","type":"git"},"_npmVersion":"11.11.1","description":"Universal bar/QR code generation library for TypeScript & JavaScript — zero dependencies, works in browser, Node and Deno.","directories":{},"sideEffects":false,"_nodeVersion":"25.8.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.3.5","typescript":"^5.7.2","@types/node":"^22.10.0"},"_npmOperationalInternal":{"tmp":"tmp/barcodes_0.1.2_1784756235083_0.8835497794758842","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@ashaffah/barcodes","version":"0.1.3","keywords":["barcode","qrcode","ean","ean13","upc","code128","code39","code93","codabar","itf","gs1","databar","pdf417","datamatrix","aztec","postal","imb","rm4scc","svg"],"author":{"name":"ashaffah"},"license":"MIT","_id":"@ashaffah/barcodes@0.1.3","maintainers":[{"name":"ashaffah","email":"wagamama.morph@gmail.com"}],"homepage":"https://github.com/ashaffah/ts-barcodes#readme","bugs":{"url":"https://github.com/ashaffah/ts-barcodes/issues"},"dist":{"shasum":"98e39b3538a9f5ae84407792ffc565df2e711ed0","tarball":"https://registry.npmjs.org/@ashaffah/barcodes/-/barcodes-0.1.3.tgz","fileCount":7,"integrity":"sha512-7lcHy3Tq0UhjOgcsHU3tNhEiQ51N/rFrKeXLgiad6/LzFTpji5u4rgVQfYnMDxMLmVA4aLp1w7zJZ+3bTE8CYQ==","signatures":[{"sig":"MEUCIH/tm1HzoT+6sErkxtB9dj6dilypmsZz9dzzs+ebDQwDAiEA4qWc52Sit81MSKoaDB74xEq2x4pDrd1OiB5BJ+0/6Ts=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":276877},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"d5ac3272967b1038888ccc0e63cfc2dc61e63951","scripts":{"build":"tsup src/index.ts --format esm,cjs --dts --clean","verify":"tsx scripts/gen.ts","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"ashaffah","email":"wagamama.morph@gmail.com"},"repository":{"url":"git+https://github.com/ashaffah/ts-barcodes.git","type":"git"},"_npmVersion":"11.11.1","description":"Universal bar/QR code generation library for TypeScript & JavaScript — zero dependencies, works in browser, Node and Deno.","directories":{},"sideEffects":false,"_nodeVersion":"25.8.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.3.5","typescript":"^5.7.2","@types/node":"^22.10.0"},"_npmOperationalInternal":{"tmp":"tmp/barcodes_0.1.3_1784757572139_0.21349921551451856","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@ashaffah/barcodes","version":"0.1.4","description":"Universal bar/QR code generation library for TypeScript & JavaScript — zero dependencies, works in browser, Node and Deno.","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"sideEffects":false,"publishConfig":{"access":"public"},"scripts":{"build":"tsup src/index.ts --format esm,cjs --dts --clean","typecheck":"tsc --noEmit","verify":"tsx scripts/gen.ts","prepublishOnly":"npm run build"},"keywords":["barcode","qrcode","ean","ean13","upc","code128","code39","code93","codabar","itf","gs1","databar","pdf417","datamatrix","aztec","postal","imb","rm4scc","svg"],"author":{"name":"ashaffah"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ashaffah/ts-barcodes.git"},"homepage":"https://github.com/ashaffah/ts-barcodes#readme","bugs":{"url":"https://github.com/ashaffah/ts-barcodes/issues"},"engines":{"node":">=18"},"devDependencies":{"@types/node":"^22.10.0","tsup":"^8.3.5","tsx":"^4.19.2","typescript":"^5.7.2"},"gitHead":"3405e31c2abe5cc8ac53c437c523eb8cf11de79b","_id":"@ashaffah/barcodes@0.1.4","_nodeVersion":"25.8.2","_npmVersion":"11.11.1","dist":{"integrity":"sha512-RfKRqwuVJP492Tm4vJRrIgHtGothCDuq+/bN+HP4gm16JT9xW7pbMizAfs9CsruY8OGDsMfoP4CYsHWVWoAv1Q==","shasum":"6e4c278d256e0a0c18b48b152c8c9f94724cda09","tarball":"https://registry.npmjs.org/@ashaffah/barcodes/-/barcodes-0.1.4.tgz","fileCount":7,"unpackedSize":276444,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDTq7cCRmLyE2/JZFi3bnOSlYsJpFTY7FPxBKQkm7KqiAiADevbm9+Up6lvH76ba1ah4UBog3cXAwiPU8sIflDnISA=="}]},"_npmUser":{"name":"ashaffah","email":"wagamama.morph@gmail.com"},"directories":{},"maintainers":[{"name":"ashaffah","email":"wagamama.morph@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/barcodes_0.1.4_1784758070184_0.576141464218862"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-13T02:36:10.148Z","modified":"2026-07-22T22:07:50.463Z","0.1.0":"2026-07-13T02:36:10.493Z","0.1.1":"2026-07-22T21:12:41.474Z","0.1.2":"2026-07-22T21:37:15.226Z","0.1.3":"2026-07-22T21:59:32.284Z","0.1.4":"2026-07-22T22:07:50.323Z"},"bugs":{"url":"https://github.com/ashaffah/ts-barcodes/issues"},"author":{"name":"ashaffah"},"license":"MIT","homepage":"https://github.com/ashaffah/ts-barcodes#readme","keywords":["barcode","qrcode","ean","ean13","upc","code128","code39","code93","codabar","itf","gs1","databar","pdf417","datamatrix","aztec","postal","imb","rm4scc","svg"],"repository":{"type":"git","url":"git+https://github.com/ashaffah/ts-barcodes.git"},"description":"Universal bar/QR code generation library for TypeScript & JavaScript — zero dependencies, works in browser, Node and Deno.","maintainers":[{"name":"ashaffah","email":"wagamama.morph@gmail.com"}],"readme":"# @ashaffah/barcodes\n\nA **universal bar/QR code generation library** for TypeScript & JavaScript.\nZero runtime dependencies, works in the browser, Node and Deno. A faithful port\nof the Rust [`barcodes`](https://crates.io/crates/barcodes) crate — every\nsymbology is verified against real decoders (ZXing, zbar, dmtxread) or, for the\n4-state postal codes, bit-for-bit against zint.\n\n## Features\n\n- **17 symbologies**: linear, 2D and postal\n- Zero runtime dependencies\n- SVG output built in (`toSVG()`); raw module data for custom rendering\n- ESM + CJS, fully typed\n- Universal: browser, Node, Deno\n\n## Install\n\n```sh\nnpm install @ashaffah/barcodes\n```\n\n## Usage\n\nEvery encoder exposes a static `encode()` that returns a `Barcode`:\n\n```ts\nimport { Ean13, QrCode, toSVG } from \"@ashaffah/barcodes\";\n\n// Linear\nconst ean = Ean13.encode(\"5901234123457\");\nconst svg = ean.toSVG(); // -> \"<svg ...>...</svg>\"\nconsole.log(ean.data.kind); // \"linear\"\n\n// QR (auto numeric/alphanumeric/byte selection)\nconst qr = QrCode.encode(\"https://example.com\");\nconsole.log(qr.data.kind); // \"matrix\"\n```\n\n### Raw modules\n\n`Barcode.data` is a discriminated union you can render however you like:\n\n```ts\nconst qr = QrCode.encode(\"HELLO\");\nif (qr.data.kind === \"matrix\") {\n  const { modules, width, height } = qr.data; // modules[y][x] === true → dark\n}\n\nconst bc = Ean13.encode(\"5901234123457\");\nif (bc.data.kind === \"linear\") {\n  const { bars, height } = bc.data; // bars[i] === true → dark bar\n}\n```\n\n### SVG options\n\n```ts\nean.toSVG({ moduleSize: 6, foreground: \"#111\", background: \"#fff\", linearQuiet: 20 });\n```\n\n### QR options\n\n`QrCode.encode()` uses sensible defaults (ECC Medium, automatic version and\nmask). For control, pass options or use the native API:\n\n```ts\nimport { QrCode, Ecc } from \"@ashaffah/barcodes\";\n\nQrCode.encode(\"payload\", { ecl: Ecc.HIGH, minVersion: 5, mask: 3 });\n\n// Native API with getModule():\nconst q = QrCode.encodeText(\"payload\", { ecl: Ecc.QUARTILE });\nq.getModule(0, 0); // boolean\nq.version; // 1..40\n```\n\n## Supported symbologies\n\n| Symbology                   | Class        | Verified with      |\n| --------------------------- | ------------ | ------------------ |\n| EAN-13                      | `Ean13`      | ZXing + zbar       |\n| EAN-8                       | `Ean8`       | ZXing + zbar       |\n| UPC-A                       | `UpcA`       | ZXing + zbar       |\n| UPC-E                       | `UpcE`       | ZXing + zbar       |\n| Code 128 (A/B/C)            | `Code128`    | ZXing + zbar       |\n| Code 39                     | `Code39`     | ZXing + zbar       |\n| Code 93                     | `Code93`     | ZXing + zbar       |\n| Codabar                     | `Codabar`    | ZXing + zbar       |\n| ITF (Interleaved 2 of 5)    | `Itf`        | ZXing + zbar       |\n| GS1-128                     | `Gs1_128`    | ZXing + zbar       |\n| GS1 DataBar Omnidirectional | `DataBar`    | ZXing + zbar       |\n| QR Code (Model 2)           | `QrCode`     | ZXing + zbar       |\n| Data Matrix (ECC 200)       | `DataMatrix` | ZXing + dmtxread   |\n| PDF417                      | `Pdf417`     | ZXing              |\n| Aztec Code                  | `Aztec`      | ZXing              |\n| USPS Intelligent Mail (IMb) | `Imb`        | zint + USPS vector |\n| Royal Mail RM4SCC           | `Rm4scc`     | zint               |\n\n## Input notes\n\n- **EAN/UPC**: pass with or without the trailing check digit — it is computed\n  and validated automatically.\n- **Codabar**: `A`/`B` start/stop guards are added automatically; pass bare data.\n- **GS1-128**: parenthesized AI format, e.g. `Gs1_128.encode(\"(01)0123...\")`.\n- **DataBar**: 13- or 14-digit GTIN.\n- **IMb**: `Imb.encode(\"01234567094987654321-01234567891\")` (20-digit tracker,\n  optional `-` + 0/5/9/11-digit routing code). Postal 4-state codes render as a\n  3-row matrix (ascender / tracker / descender).\n\n## Errors\n\nEncoders throw `EncodeError` (with a `.kind` of `\"InvalidInput\"`,\n`\"InvalidCharacter\"` or `\"DataTooLong\"`) on invalid input.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}