
Product
Secure Your AI-Generated Code with Socket MCP
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
barcode-js
Advanced tools
Barcode Xpress for Node.js enables developers to add the ability to read common industry 1D and 2D barcodes in their applications.
node -v
)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).
// 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);
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;
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/v14.1/BxNodeJs/webframe.html.
In order to run the license manager, you will need:
java -version
JRE 1.8 or later.Barcode Xpress also includes detailed API documentation and a Getting Started guide.
Need more documentation? Check out the User's Guide
:
https://help.accusoft.com/BarcodeXpress/v14.1/BxNodeJs/webframe.html
Need help? Contact Accusoft at sales@accusoft.com.
FAQs
A node addon to perform barcode recognition and analysis
The npm package barcode-js receives a total of 24 weekly downloads. As such, barcode-js popularity was classified as not popular.
We found that barcode-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Product
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.