New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@rxing/rxing

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rxing/rxing

Node.js bindings for the rxing library, which is a Rust port of the ZXing barcode library.

latest
npmnpm
Version
0.0.2
Version published
Weekly downloads
2
-86.67%
Maintainers
1
Weekly downloads
 
Created
Source

rxing-bindings

Node.js bindings for the rxing library, which is a Rust port of the ZXing barcode library.

Installation

npm install @rxing/rxing

Usage

Decode a barcode from an image

const { decode } = require('@rxing/rxing');
const result = decode('path/to/image.png'); // image path or a base64 encoded string

console.log(result);

Encode a barcode

const { encode } = require('@rxing/rxing');
const result = encode('hello world'/*, { outputFile: 'path/to/qrcode.jpg' } */);

fs.writeFileSync('hello-world.jpg', result);

API

decode(input: string, options?: DecodeOptions): DecodeResult | Array<DecodeResult> | null

Decode a barcode from a file or base64 string.

input

Type: string

The path to the image file or a base64 encoded string.

options

Type: DecodeOptions

encode(data: string, options?: EncodeOptions): Buffer

Encode a barcode from a string, returning a buffer representing the image.

data

Type: string

The data to encode.

options

Type: EncodeOptions

License

Keywords

rxing

FAQs

Package last updated on 09 Feb 2023

Related posts