JavaScript wrapper library for the GS1 Barcode Syntax Engine compiled as a Wasm by Emscripten.
The GS1 Barcode Syntax Engine provides routines that support the processing of GS1 syntax data, including Application Identifier element strings and GS1 Digital Link URIs, whether these are provided in raw or human-friendly format or as normalised scan data received from barcode readers.
Full API documentation with usage examples is available at: https://gs1.github.io/gs1-syntax-engine/js-wasm/
npm init es6
npm install gs1encoderimport { GS1encoder } from "gs1encoder";
const gs = await GS1encoder.create();
gs.aiDataStr = "(01)09521234543213(99)TESTING123";
console.log("GS1 Digital Link URI: " + gs.getDLuri("https://example.com"));
gs.free(); // Release native resources when doneNote: Each GS1encoder instance allocates native resources. Call free() when you
are finished with an instance to release these resources promptly.
- Node.js: example.node.mjs
- Browser: example.html with example.mjs
This library includes type definitions (.d.ts file) that provide compile-time
type checking in TypeScript projects and autocompletion in many IDEs.