Built with 🦀🕸 by The Rust and WebAssembly Working Group
This is an example repo that I used on my talk for a local meetup in Singapore. You can watch the full talk on YouTube
- Install Rust
- Install wasm-pack
- Install Node
Run npm install
to pull in the dependencies.
- Run
wasm-pack build
(this needs to be done every time after change in Rust code) - Run
npm start
- Go to
http://localhost:8080
- Run
cd server && python3 server.py
This repo contains one big csv file with over 1 million record.
To store large files in a repository, we use Git LFS.
Steps to install:
- Install Git LFS
- Run
sudo apt-get install git-lfs
- Run
git lfs pull
in this repository - The file will be downloaded in the
data
folder
📚 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
.
Learn more about cargo generate
here.
cargo generate --git https://github.com/rustwasm/wasm-pack-template.git --name my-project
cd my-project
wasm-pack build
wasm-pack test --headless --firefox
wasm-pack publish
wasm-bindgen
for communicating between WebAssembly and JavaScript.console_error_panic_hook
for logging panic messages to the developer console.wee_alloc
, an allocator optimized for small code size.