u-wasm
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published
import { createWasm,useCCall,useCWrap } from "u-wasm";
import { readFileSync } from "fs";
const buf = readFileSync("./math.wasm");
const cwrap = useCWrap();
const ccall = useCCall();
const w = await createWasm(buf);
const wasm = w.use(cwrap).use(ccall);
console.log(wasm.ccall("add", 1, 1));
const fib = wasm.cwrap("fib");
console.log(fib(10));
return wasm;

Readme

Keywords

none

Package Sidebar

Install

npm i u-wasm

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

7.37 kB

Total Files

7

Last publish

Collaborators

  • ahaoboy