@flowscripter/template-bun-wasm-rust-library

1.0.6 • Public • Published

template-bun-wasm-rust-library

version build coverage docs license: MIT

Project template for a Rust library compiled to WASM exposed as a Bun module.

Template Usage

Create a new Bun project using this as a template:

bun create @flowscripter/template-bun-wasm-rust-library

Bun Module Usage

Add the module:

bun add @flowscripter/template-bun-wasm-rust-library

Use the module:

import { world } from "@flowscripter/template-bun-wasm-rust-library";

world();

Development

Install wasm-pack:

cargo install wasm-pack

Install dependencies:

bun install

Build (remove generated .gitignore to allow npm publish from root of repository):

wasm-pack build --target web --release --no-pack && rm pkg/.gitignore

Test:

cargo test && bun test

NOTE: The following tasks use Deno as it excels at these and Bun does not currently provide such functionality:

Format:

deno fmt

Lint:

cargo fmt && deno lint index.ts src/ tests/

Generate HTML API Documentation:

deno doc --html --name=template-bun-wasm-rust-library index.ts

Documentation

Overview

Sample mermaid diagram to test rendering in markdown:

classDiagram
    Foo <|-- Bar

API

Link to auto-generated API docs:

API Documentation

License

MIT © Flowscripter

Package Sidebar

Install

npm i @flowscripter/template-bun-wasm-rust-library

Weekly Downloads

43

Version

1.0.6

License

MIT

Unpacked Size

12.3 kB

Total Files

10

Last publish

Collaborators

  • vectronic