Skip to content

yusinto/node-wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4e44a80 · Feb 17, 2018

History

20 Commits
Feb 11, 2018
Feb 17, 2018
Feb 17, 2018
Feb 10, 2018
Feb 10, 2018
Feb 10, 2018
Feb 17, 2018
Feb 17, 2018
Feb 10, 2018

Repository files navigation

node-wasm

npm version npm downloads npm npm

Bare minimum util to import and use wasm in node 🚤

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.