npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

barcode-js

v13.9.3174

Published

A node addon to perform barcode recognition and analysis

Downloads

119

Readme

BarcodeXpress

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.

Getting Started

  1. Make sure you have the following system requirements:
    • Windows x64 operating systems of the following versions:
      • Windows 8.1
      • Windows 10
      • Windows Server 2012 (and R2)
      • Windows Server 2016
      • Windows Server 2019
    • Linux x64 operating systems of the following versions:
      • Ubuntu 18.04
      • Ubuntu 20.04
      • CentOS 7
      • CentOS 8
      • Debian 9
      • Debian 10
    • Node.js versions 12, 14, 16 and npm (to check the version use the following command: node -v)
  2. Clone and run the Hello Barcode Xpress for Node.js Sample

Although Barcode Xpress for Node.js may run, it is not supported on earlier operating system versions (for example, Ubuntu 14.04 or Windows 7).

Reading Barcodes

// Import packages.
const bx = require("barcode-js");

// Set up logging function.
const logResults = (results) => console.log(JSON.stringify(results, ["type", "value", "confidence"], 2));

// Set up analysis function.
const analyzeBarcodes = async (filePath) => {
    try {
        const results = await bx.analyze(filePath);
        logResults(results);
    }
    catch(err) {
        console.error(`Fatal: Error analyzing image input\n${err}`);
    }
};

// Set up parameters.
// Accepted file types are bmp, tiff, jpg, gif, png, and url
const filePath = "test.bmp";

// Call analyze.
analyzeBarcodes(filePath);

Accessing Results

The analyze method returns an array of result objects.

Each result object has the following structure:

{
    "type": barcodeType,
    "value": barcodeValue,
    "area": {
        "x": xCoordinateBarcodeStart,
        "y": yCoordinateBarcodeStart,
        "height": barcodeHeight,
        "width": barcodeWidth
    },
    "corners": [
    {
        "x": xCoordinateTopLeft,
        "y": yCoordinateTopLeft
    },
    {
        "x": xCoordinateTopRight,
        "y": yCoordinateTopRight
    },
        {
        "x": xCoordinateBottomRight,
        "y": yCoordinateBottomRight
    },
        {
        "x": xCoordinateBottomLeft,
        "y": yCoordinateBottomLeft
    }
    ],
    "confidence": recognitionConfidence
}

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

const barcodeValue = result.confidence;

or to get the height property of a recognized barcode:

const barcodeHeight = result.area.height;

Licensing

Barcode Xpress for Node.js comes with an evaluation license pre-installed, so you can get started right away.

For development and deployment licenses, and more information on licensing in general, please visit our online documention at https://help.accusoft.com/BarcodeXpress/v13.9/BxNodeJs/webframe.html.

In order to run the license manager, you will need:

  • java -version JRE 1.8 or later.

More Documentation and Support

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