Skip to content

AMorgaut/systemjs-plugin-wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NPM version ISC Licensed

systemjs-plugin-wasm

SystemJS plugin for loading and instanciating Web Assembly modules providing native like performances.

Should Work with

  • lastest Firefox (52) and Chrome (57) releases
  • lastest Opera via the #enable-webassembly flag
  • upcoming MS Edge via the "Experimental JavaScript Features flag"

See Can I Use Web Assembly

You can generate Web Assembly modules from C/C++ using the EMScripten (aka emcc) Compiler

Usage

ES6 Static import

Via jspm or Babel + babel plugin es2015-modules-systemjs

import myApi from 'myWebAssemblyModule.wasm!';

myApi.myFunction();

Dynamic Import

const myApi = (await System.import('myWebAssemblyModule.wasm!')).default;

myApi.myFunction();

Installation

npm

  npm install systemjs-plugin-wasm

jspm

jspm install wasm

Configuration

Create a map configuration to the plugin:

System.config({
  map: {
    'wasm': 'node_modules/systemjs-plugin-wasm/wasm.js'
  }
})

About

SystemJS plugin for loading and instanciating Web Assembly modules

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published