Commit 13dae27ceeb5fe7023f74c8ba13a8c3c1ac3ecfd
update readme
Signed-off-by: wanderer <mjbecze@gmail.com>wanderer committed on 10/22/2017, 9:22:27 PM
Parent: b0681a5e23f163393ec4b946ea5f4466dcf34e9f
Files changed
README.md | changed |
README.md | ||
---|---|---|
@@ -3,13 +3,31 @@ | ||
3 | 3 … | [![Coverage Status](https://img.shields.io/coveralls/primea/js-primea-wasm-container.svg?style=flat-square)](https://coveralls.io/primea/js-primea-wasm-container) |
4 | 4 … | |
5 | 5 … | [![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) |
6 | 6 … | |
7 | -# install | |
8 | -`npm install primea-wasm-container` | |
9 | - | |
10 | 7 … | # SYNOPSIS |
11 | 8 … | This implements a wasm container for the ewasm-kernel |
12 | 9 … | |
10 … | +# INSTALL | |
11 … | +`npm install primea-wasm-container` | |
13 | 12 … | |
13 … | +# USAGE | |
14 … | +``` | |
15 … | +const WasmContainer = require('primea-wasm-container') | |
16 … | + | |
17 … | +// this class with get instantiated when a new wasm container instance is created | |
18 … | +// its methods with be exposed to the wasm binary as `imports` | |
19 … | +class HelloWorld { | |
20 … | + test () { | |
21 … | + console.log('hello world!') | |
22 … | + } | |
23 … | +} | |
24 … | + | |
25 … | +// regester the container with the a hypervisor instance | |
26 … | +hypervisor.registerContainer(WasmContainer, { | |
27 … | + env: HelloWorld | |
28 … | +}) | |
29 … | + | |
30 … | +``` | |
31 … | + | |
14 | 32 … | # LICENSE |
15 | 33 … | [MPL-2.0](https://tldrlegal.com/license/mozilla-public-license-2.0-(mpl-2)) |
Built with git-ssb-web