wasi-kernel
TypeScript icon, indicating that this package has built-in type declarations

0.1.6 • Public • Published

wasi-kernel

Simple process management, streams, and shared file system for WASM modules running in workers, based on WASI and Wasmer-JS.

The current version is compatible with wasi-sdk 12.

Build

To startup the project, you first need to do:

npm i

The build uses Parcel. It is not listed as a project dependency due to its size. Install it globally instead via:

npm i -g parcel

(The project was developed with Parcel 1.12.4, and may not be compatible with 2.x, if this version ever materializes.)

To build Node.js modules and the Web worker:

npm run build

You can quickly test your build by running parcel shell.html, then directing your browser to http://localhost:1234/.

Use

When developing your own project that uses wasi-kernel, employ standard import statements and run Parcel on your main entry point (HTML or JavaScript). When targeting the browser, bundlers are directed to the source entry point (src/kernel/index.ts), which exposes the public APIs.

import { WorkerProcess } from 'wasi-kernel';

p = new WorkerProcess('/uri/of/prog.wasm');

/wasi-kernel/

    Package Sidebar

    Install

    npm i wasi-kernel

    Weekly Downloads

    10

    Version

    0.1.6

    License

    ISC

    Unpacked Size

    935 kB

    Total Files

    83

    Last publish

    Collaborators

    • corwin.amber