cellular-automaton 0.1.8

A cellular automaton simulation library with support for WebAssembly.
Documentation

1. Install

# Cargo.toml
[dependencies]
cellular-automaton = "0.1.8"

2. Compile

  • Compile, generate .js and .d.ts bindings, and generate an npm package with wasm-pack

    wasm-pack build
    
  • Compile and generate .js and .d.ts bindings with wasm-bindgen-cli

    1. Install the wasm32-unknown-unknown compilation target

      rustup target add wasm32-unknown-unknown
      
    2. Build

      cargo build --target wasm32-unknown-unknown
      
    3. Run

      wasm-bindgen --out-dir pkg/ ./target/wasm32-unknown-unknown/release/cellular_automaton.wasm
      

3. Optimize

Optimize for binary size with wasm-opt using -Os or -Oz

wasm-opt -Os ./pkg/cellular_automaton_bg.wasm -o ./pkg/cellular_automaton_bg.wasm