0.1.0 • Published 7 years ago
wequire v0.1.0
wequire
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 theimportObject
argument to theWebAssembly.Instance()
constructor.
- Returns
- object - The
exports
property of aWebAssembly.Instance
.
- object - The
0.1.0
7 years ago