Node.js bindings for the rxing library, which is a Rust port of the ZXing barcode library.
npm install @rxing/rxing
const { decode } = require('@rxing/rxing');
const result = decode('path/to/image.png'); // image path or a base64 encoded string
console.log(result);
const { encode } = require('@rxing/rxing');
const result = encode('hello world'/*, { outputFile: 'path/to/qrcode.jpg' } */);
fs.writeFileSync('hello-world.jpg', result);
Decode a barcode from a file or base64 string.
Type: string
The path to the image file or a base64 encoded string.
Type: DecodeOptions
Encode a barcode from a string, returning a buffer representing the image.
Type: string
The data to encode.
Type: EncodeOptions