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.