how-to-use.mp4
Visit here: https://kenhino.github.io/energy-unit-converter/
A Rust-based energy unit converter that runs in the browser via WebAssembly.
The UI can switch between the ase.units CODATA datasets (1986 through 2022), with 2018 selected by default.
# Add the WASM compilation target
rustup target add wasm32-unknown-unknown
# Install wasm-pack
cargo install wasm-pack
# Install frontend dependencies
cd www && npm install# 1. Build the Rust WASM package (from repo root)
wasm-pack build --target web
# 2. Start the dev server
cd www
npm run devOpen http://localhost:5173 in your browser.
Re-run
wasm-pack build --target webwhenever you change Rust source code.
| Command | Description |
|---|---|
cargo test |
Run Rust tests |
cargo clippy |
Lint Rust code |
cargo fmt |
Format Rust code |
cd www && npm run build |
Build production assets |
cd www && npm run preview |
Preview production build |
cd www && npm test |
Run frontend tests |