New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

node-zbardecoder

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

node-zbardecoder

Bar/Qr code image decoder

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

Barcode Reader

This barcode reader is a Node.js C++ addon wrapper over the open source ZBar and OpenCV libraries.

It works with a static image files, supports multiple barcodes in the image and detects barcode types.

Requirements

ZBar code reader and OpenCV have to be installed on your machine.

Installation

Before npm install you need to install packages.

For linux users:

    apt-get install libzbar0 libzbar-dev
    apt-get install python3-opencv libopencv-dev
or
    yum install zbar zbar-devel
    yum install opencv opencv-devel

After this install Barcode Reader

    npm i node-zbardecoder

Usage

const bardecoder = require('node-zbardecoder');

const result = JSON.parse(bardecoder.decode('image.jpg'));
console.log(result);

/*
{
  results: [
    { type: 'CODE-128', data: 'ARD000083' },
    { type: 'CODE-128', data: 'ARD000066' }
  ]
} 
*/

Recommendations

For better results use images no larger then 1500px on the long side and images with sharp and large barcodes.

See the test folder for example.

Keywords

bar

FAQs

Package last updated on 19 Dec 2019

Did you know?

Socket

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.

Install

Related posts