node-wasm

v0.1.3
A bare minimum util to import and use wasm in node
node import require wasm loader node-wasm nodewasm load

node-wasm

npm version npm downloads npm npm

Bare minimum util to import and use wasm in node :clap:

This is still work in progress.

Installation

yarn add node-wasm

Quickstart

import loadWasm from 'node-wasm';

async function run() {
  const {rust_function} = await loadWasm('/local/path/to/wasm');
  const result = rust_function();
  console.log(result);
}

run();

Example

Check the node example for a simple demo.

The corresponding rust example is also available for you to play with.

Metadata

  • ISC
  • Whatever
  • Yusinto Ngadiman
  • released 2/11/2018

Downloads

Maintainers