0.1.0 • Published 7 years ago

wequire v0.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

wequire

Current Version Build Status via Travis CI Dependencies belly-button-style

Synchronously load WebAssembly (.wasm) files.

Basic Usage

Pass an absolute filename to the wequire() function. The result is the exports property of a WebAssembly.Instance.

const Wequire = require('wequire');
const Path = require('path');
const mod = Wequire(Path.join(__dirname, 'test.wasm'));

console.log(mod);

Methods

A single function is exported.

wequire(request[, imports])

  • Arguments
    • request (string) - The absolute path to a .wasm file.
    • imports (object) - An optional argument passed as the importObject argument to the WebAssembly.Instance() constructor.
  • Returns
    • object - The exports property of a WebAssembly.Instance.