#template #repository

flowscripter_template_wasm_rust_library

Project template for a Rust library compiled to WASM

11 stable releases

1.1.9 Oct 3, 2022
1.1.8 Sep 20, 2022
1.1.6 May 25, 2022
1.1.0 Apr 27, 2022

#295 in WebAssembly

26 downloads per month

MIT license

5KB

template-wasm-rust-library

version build coverage dependencies rust doc license: MIT

Project template for a Rust library compiled to WASM.

Project Template Usage

  1. Use as a template to create a new repository.
  2. Update links and references in README.md.

ESM Dependency Usage

import * as wasmLib from "https://flowscripter.github.io/template-wasm-rust-library/flowscripter_template_wasm_rust_library.js";

// init WASM module
await wasmLib.default();

// use WASM module
wasmLib.add(2, 2);

Development

Install wasm-pack: cargo install wasm-pack

Install Firefox

Build: wasm-pack build --target web

Test: cargo test && wasm-pack test --headless --firefox

Lint: cargo fmt

Documentation

Overview

classDiagram
    Foo <|-- Bar

API

Link to auto-generated API docs for the library:

API Documentation

License

MIT © Flowscripter

Dependencies

~0.7–1.4MB
~28K SLoC