Socket
Socket
Sign inDemoInstall

barcode-validator

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

barcode-validator

A tiny JavaScript library for validating barcodes.


Version published
Maintainers
1
Created
Source

Barcode Validator npm package

A tiny JavaScript library for validating barcodes.

Supported symbologies: EAN-13, EAN-8, UPC-A, and UPC-E. For more information on the validation algorithm, see official GS1 guide on calculating valid barcode check digits.


Usage

First, install barcode-validator using npm:

npm i barcode-validator

Then, import the package into your module like so:

import validbarcode from "barcode-validator";
// or const validbarcode = require("barcode-validator");

Pass it a barcode (string or number) for validation and get back a boolean.

validbarcode("6151100036810"); // true
validbarcode(87162318); // true
validbarcode(972660036810); // false

License

Barcode Validator is MIT licensed. See license file for more information.

Keywords

FAQs

Package last updated on 01 Nov 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc