Skip to content
This repository has been archived by the owner on Dec 28, 2019. It is now read-only.

cjihrig/wequire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.