notmandatory / caravan-rs

rust wasm caravan tools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

caravan-rs

An example Rust and WebAssembly project using wasm-pack.

About

πŸ“š Read this template tutorial! πŸ“š

This template is designed for compiling Rust libraries into WebAssembly and publishing the resulting package to NPM.

Be sure to check out other wasm-pack tutorials online for other templates and usages of wasm-pack.

🚴 Usage

🍺 Install LLVM

On MacOS

Using brew:

brew install llvm

# make sure it's in your path
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"

# for older homebrew installs
# export PATH="/usr/local/opt/llvm/bin:$PATH"
export CC=/opt/homebrew/opt/llvm/bin/clang
export AR=/opt/homebrew/opt/llvm/bin/llvm-ar

πŸ› οΈ Build with wasm-pack build

wasm-pack build

πŸ”¬ Test in Headless Browsers with wasm-pack test

wasm-pack test --headless --firefox

🎁 Publish to NPM with wasm-pack publish

wasm-pack publish

πŸ”‹ Batteries Included

  • wasm-bindgen for communicating between WebAssembly and JavaScript.
  • console_error_panic_hook for logging panic messages to the developer console.
  • LICENSE-APACHE and LICENSE-MIT: most Rust projects are licensed this way, so these are included for you

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

rust wasm caravan tools

License:Apache License 2.0


Languages

Language:Rust 100.0%