0.2.0 • Published 1 year ago
@wk3368/hello-wasm v0.2.0
A demo of https://developer.mozilla.org/zh-CN/docs/WebAssembly/Rust_to_wasm
Attention
use wasm-pack build --release --target web --scope mynpmusername
instead of wasm-pack build --scope mynpmusername
so we can import init from '@mynpmusername/hello-wasm'
, then use init().then(greet('name'))
other wise, you will got error in console: Uncaught TypeError: Cannot read properties of undefined (reading '__wbindgen_malloc')