npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

barcode-js

11.0.198 • Public • Published

The barcode solution for Node.js developers.

What is Barcode Xpress?

Barcode Xpress for Node.js enables developers to add the ability to read common industry 1D and 2D barcodes in their applications.

  • Barcode Types - recognize over 30 different types of barcodes.
  • Structured Results - results are organized in a hierarchical model where every barcode has a value, type, confidence, and location.
  • Simple - by providing only a minimal asynchronous API, Barcode Xpress is easy to learn. With a few lines of code, recognize barcodes found in images produced by scanners, cameras, or fax machines.

Read Barcodes with Fewer than 20 Lines of Code

  1. Make sure you have the following system requirements:
    • Linux 64 bit.
    • node -v 4.0 or greater and npm.
    • gcc --version 4.8.1 or greater.
    • g++ -v 4.8.1 or greater.
    • java -version JRE 1.7 or later.
    • libstdc++-static (CentOS only) 4.8.1 or greater
  2. Register an email address for a free account to get access to our Barcode Xpress evaluation version
  3. npm install barcode-js
  4. Run the license utility to install an eval licensing:
    • GUI registration: cd node_modules/barcode-js && npm run register
    • CLI registration: cd node_modules/barcode-js && npm run register -- youremail@domain.com
  5. Use the following to get a taste of what Barcode Xpress can do:
var bx = require('barcode-js');
 
// Set default values. 
var params = {
    input: 'filePath/fileName.bmp',
    type: 'code39'
};
   
bx.analyze(params, function (err, results) {
    if (err) {
        console.log ('There was an error processing this image: ' + err);
        return;
    }
    results.forEach(function(result) {
        console.log ('Result type ' + result.type);
        console.log ('\t' + 'value ' + result.value);
    });
});

Accessing Results

The analyze method returns an array of result objects.

For example, to get the confidence of the barcode recognized:

var barcode-value = result.confidence;

The following provides access to the height property of the area object:

var barcode-height = item.area.height;

More Documentation and Support

Barcode Xpress also includes detailed API documentation and a Getting Started guide.

  • Need more documentation? Check out the User's Guide.
  • Need help? Call Accusoft at (813) 875-7575.

install

npm i barcode-js

Downloadsweekly downloads

8

version

11.0.198

license

SEE LICENSE IN licensing/AccusoftLicenseAgreement.txt

last publish

collaborators

  • avatar
Report a vulnerability