A webassembly package written in Rust that exports the GS1 crate and adds some convenience features for batch processing. It uses wasm-pack for building.
Because WebAssembly is meant to be loaded asynchronous, an extra step is necessary to use this library. Assuming a webpack environment that supports import()
:
// loading the package returns a promise
const loadGS1 = import('gs1-wasm')
loadGS1.then(gs1 => {
/* use library */
})
To build the package, wasm-pack
is used. You also need to make sure that you have the wasm32-unknown-unknown target installed:
rustup target add wasm32-unknown-unknown
cargo install wasm-pack
Now the package can be build with wasm-pack build
.