@robinpath/barcode
Advanced tools
+97
| # @robinpath/barcode | ||
| > QR code generation, EAN/UPC barcode validation, ISBN conversion, and Luhn checksum | ||
|     | ||
| ## Why use this module? | ||
| The `barcode` module lets you: | ||
| - Generate QR code as data URL | ||
| - Generate QR code to file | ||
| - Generate QR code as SVG | ||
| - Generate QR for terminal | ||
| - Validate EAN-13 barcode | ||
| All functions are callable directly from RobinPath scripts with a simple, consistent API. | ||
| ## Installation | ||
| ```bash | ||
| npm install @robinpath/barcode | ||
| ``` | ||
| ## Quick Start | ||
| No credentials needed — start using it right away: | ||
| ```robinpath | ||
| barcode.qrToFile "https://example.com" "./qr.png" | ||
| ``` | ||
| ## Available Functions | ||
| | Function | Description | | ||
| |----------|-------------| | ||
| | `barcode.qrGenerate` | Generate QR code as data URL | | ||
| | `barcode.qrToFile` | Generate QR code to file | | ||
| | `barcode.qrToSvg` | Generate QR code as SVG | | ||
| | `barcode.qrToTerminal` | Generate QR for terminal | | ||
| | `barcode.ean13Validate` | Validate EAN-13 barcode | | ||
| | `barcode.ean13Checksum` | Calculate EAN-13 check digit | | ||
| | `barcode.upcValidate` | Validate UPC-A barcode | | ||
| | `barcode.upcChecksum` | Calculate UPC-A check digit | | ||
| | `barcode.isbn10Validate` | Validate ISBN-10 | | ||
| | `barcode.isbn13Validate` | Validate ISBN-13 | | ||
| | `barcode.isbn10to13` | Convert ISBN-10 to ISBN-13 | | ||
| | `barcode.isbn13to10` | Convert ISBN-13 to ISBN-10 | | ||
| | `barcode.luhn` | Validate Luhn checksum | | ||
| | `barcode.luhnGenerate` | Generate Luhn check digit | | ||
| ## Examples | ||
| ### Generate QR code to file | ||
| ```robinpath | ||
| barcode.qrToFile "https://example.com" "./qr.png" | ||
| ``` | ||
| ### Generate QR code as SVG | ||
| ```robinpath | ||
| barcode.qrToSvg "hello" | ||
| ``` | ||
| ### Generate QR for terminal | ||
| ```robinpath | ||
| barcode.qrToTerminal "hello" | ||
| ``` | ||
| ## Integration with RobinPath | ||
| ```typescript | ||
| import { RobinPath } from "@wiredwp/robinpath"; | ||
| import Module from "@robinpath/barcode"; | ||
| const rp = new RobinPath(); | ||
| rp.registerModule(Module.name, Module.functions); | ||
| rp.registerModuleMeta(Module.name, Module.functionMetadata); | ||
| const result = await rp.executeScript(` | ||
| barcode.qrToFile "https://example.com" "./qr.png" | ||
| `); | ||
| ``` | ||
| ## Full API Reference | ||
| See [MODULE.md](./MODULE.md) for complete documentation including all parameters, return types, error handling, and advanced examples. | ||
| ## Related Modules | ||
| - [`@robinpath/json`](../json) — JSON module for complementary functionality | ||
| ## License | ||
| MIT |
+29
-8
| { | ||
| "name": "@robinpath/barcode", | ||
| "version": "0.1.0", | ||
| "publishConfig": { "access": "public" }, | ||
| "version": "0.1.1", | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "type": "module", | ||
| "main": "dist/index.js", | ||
| "types": "dist/index.d.ts", | ||
| "exports": { ".": { "import": "./dist/index.js", "types": "./dist/index.d.ts" } }, | ||
| "files": ["dist"], | ||
| "scripts": { "build": "tsc", "test": "node --import tsx --test tests/*.test.ts" }, | ||
| "peerDependencies": { "@wiredwp/robinpath": ">=0.20.0" }, | ||
| "dependencies": { "qrcode": "^1.5.0" }, | ||
| "devDependencies": { "@wiredwp/robinpath": "^0.30.1", "@types/qrcode": "^1.5.0", "tsx": "^4.19.0", "typescript": "^5.6.0" } | ||
| "exports": { | ||
| ".": { | ||
| "import": "./dist/index.js", | ||
| "types": "./dist/index.d.ts" | ||
| } | ||
| }, | ||
| "files": [ | ||
| "dist" | ||
| ], | ||
| "scripts": { | ||
| "build": "tsc", | ||
| "test": "node --import tsx --test tests/*.test.ts" | ||
| }, | ||
| "peerDependencies": { | ||
| "@wiredwp/robinpath": ">=0.20.0" | ||
| }, | ||
| "dependencies": { | ||
| "qrcode": "^1.5.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@wiredwp/robinpath": "^0.30.1", | ||
| "@types/qrcode": "^1.5.0", | ||
| "tsx": "^4.19.0", | ||
| "typescript": "^5.6.0" | ||
| } | ||
| } |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
28640
10.15%10
11.11%0
-100%98
Infinity%1
Infinity%