0.1.7 • Published 4 years ago
@tedbyron/ca v0.1.7
Rust Library
# Cargo.toml
[dependencies]
cellular-automaton = "0.1"
This crate defaults to supporting WebAssembly. To build the crate without WebAssembly support, don't use the crate's default features and build to a specific target:
cargo build --no-default-features --target x86_64-unknown-linux-gnu
JavaScript Package
# npm
npm i @tedbyron/ca
# yarn
yarn add @tedbyron/ca
# pnpm
pnpm add @tedbyron/ca
The npm package has:
- A ~60kb WASM binary
- No dependencies
- JavaScript bindings to the WASM binary
- TypeScript definitions
The package is built to target webpack
(--target bundler
) but can be rebuilt from the Rust library for a different target:
wasm-pack build --target <bundler|nodejs|web|no-modules>
wasm-opt -Os pkg/cellular_automaton_bg.wasm -o pkg/cellular_automaton_bg.wasm