![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
barcode-secure
Advanced tools
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 = require('barcode');
var code39 = barcode('code39', {
data: "it works",
width: 400,
height: 100,
});
Next choose from the three methods below how you want to output your barcode.
Stream
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.
code39.getStream(function (err, readStream) {
if (err) throw err;
// 'readStream' is an instance of ReadableStream
readStream.pipe(CdnWriteStream);
});
File to disk
Save an image out to the file system, pretty simple. Just be sure to specify your outfile.
var outfile = path.join(__dirname, 'imgs', 'mycode.png')
code39.saveImage(outfile, function (err) {
if (err) throw err;
console.log('File has been written!');
});
Base64 encoded img
src
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.
code39.getBase64(function (err, imgsrc) {
if (err) throw err;
// if we're using HTTP or another framework
res.end('<img src="' + imgsrc + '">');
});
Much of the underlying code for the generation is being rewritten, however the API will remain the same. As a rule, anything new will have to be testable.
Things todo:
In the future:
gm
or output html (bars with css
or canvas)FAQs
Generate 1D and 2D barcodes
We found that barcode-secure demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.