0.1.0 • Published 8 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.wasmfile.imports(object) - An optional argument passed as theimportObjectargument to theWebAssembly.Instance()constructor.
- Returns
- object - The
exportsproperty of aWebAssembly.Instance.
- object - The
0.1.0
8 years ago