Generate 1D and 2D barcodes
npm install barcode
Set it up and specify your type and options. The following 3 are the only required ones.
var barcode = ;var code39 =;
Next choose from the three methods below how you want to output your barcode.
Get a stream of the final image data. you can collect this and save out a new PNG (default type), pipe it elsewhere, or save it to a CDN.
File to disk
Save an image out to the file system, pretty simple. Just be sure to specify your outfile.
var outfile = pathcode39;
Often times, barcodes are single use for a single print or whatever. With this method, we can create one on the fly and just send the base64 encoded image to the browser through the HTML.
Much of this will be due for a rewrite in the near future. 2.0 might make some API changes, but I will keep it as close to the original as possible.
Some goals for the rewrite:
I hope to eventually make it more maintainable this way instead of the endless amounts of spaghetti code.