Socket
Socket
Sign inDemoInstall

barcode-parser

Package Overview
Dependencies
0
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    barcode-parser

This project started out as a straight port of the Quagga project - https://serratus.github.io/quaggaJS. - to typescript however it has significantly diverged.


Version published
Maintainers
1
Install size
348 kB
Created

Changelog

Source

1.2.1 (2019-02-13)

Bug Fixes

  • package.json: Explicitly add lib files (c0b890b)

Readme

Source

Coverage Status Build Status semantic-release Commitizen friendly

Barcode-Parsing

this package has a fairly narrow scope and is used in conjunction with an Ionic project to read values provided by a physical wedge scanner and parse out the values. I am working on wrapping up the scanning angular component that consumes this directly.

Usage

    const barcodeParser = new BarcodeParser({
        readers: [
            Symbologies.Code39,
            Symbologies.ITF8,
            Symbologies.GTINX
        ],
        readerConfigurations: []
    });

    barcodeParser.parse(']I010734074010258');
    barcodeParser.parse(']C100111111111111111111101234 30100 310600100');
    barcodeParser.parse(']Z00000000');

** please note the input above with spaces would never be valid from a scanner, the spaces would instead be an invisible group seperator. This library replaces the GS character with a space before parsing so it works for both illustrative purposes and testing.

Results

]I010734074010258

    "barcodeVal": {
      "_symbology": "itf_14",
      "_rawValue": "]I010734074010258",
      "_checkDigit": 8,
      "_success": true,
      "_values": "1073407401025"
    }

]C100111111111111111111101234 30100 310600100

 "barcodeVal": {
    "_symbology": "gs1_128",
    "_rawValue": "]C100111111111111111111101234 30100 310600100",
    "_checkDigit": -1,
    "_success": true,
    "_values": [
      {
        "code": "10",
        "value": "1234"
      },
      {
        "code": "00",
        "value": "111111111111111111"
      },
      {
        "code": "30",
        "value": "100"
      },
      {
        "code": "310",
        "value": 0.0001
      }
    ]
}

]Z00000000

  "barcodeVal": {
    "_symbology": null,
    "_rawValue": "]Z00000000",
    "_checkDigit": -1,
    "_success": false,
    "_values": [],
    "_errorMessage": "No Reader Found"
  }
Roadmap
  • This package as it stands is very much a "good enough" for what we needed it for but it needs a little work before it can be used easily in an arbitrary project.
  • Reader Specific Configurations. See Code39.

FAQs

Last updated on 13 Feb 2019

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc