A Node.js utility program for generating an SVG barcode. Uses JsBarcode.
Clone or download and unzip, then in the directory run:
yarn
Or with npm:
npm install
Add an .env.local
file with:
FORMAT="ean13"
CODE="123456789123"
# Optional
SUFFIX=">"
PATH="<destination-path>"
The default destination directory is the project root and the filename is a combination of the code and format.
Then run:
yarn start
Alternatively, you can use the following in bash:
FORMAT="ean13"; CODE="123456789123"; SUFFIX=">"; yarn start
A similar method can be used for other CLIs. You can also mix and match the above methods to set your own defaults.
- If the code is invalid for the format specified, an error will be shown.
- You can omit the checksum.