This is the CaBr2 WASM library.
It is written in Rust with wasm-bindgen.
In the src/impls folder is the glue code for the CaBr2 core logic.
In order to build the WASM bindings you must first install rust
and wasm-pack.
You can install them via your package manager or from the links above.
wasm-pack can also be installed via cargo after you installed Rust:
cargo install wasm-packThe WASM binaries can be built in two flavours: an optimized version that is small or an debug version that can also display stack traces.
These two yarn commands are available:
# optimized version
yarn wasm_lib:release
# debug buid
yarn wasm_lib:debugNormally you just have to run the yarn commands but if you want to build them manually these are the commands:
# optimized version
wasm-pack build --out-dir ../cabr2_wasm --release
# debug buid
wasm-pack build --out-dir ../cabr2_wasm --dev -- --features debug_buildWe use clippy for linting and cargo fmt to check the formatting of the code:
cargo clippy --all-features -- --deny clippy::all
cargo fmt