Wasmer-JS
Monorepo of multiple JavaScript packages enabling easy use of WebAssembly Modules in Node and the Browser.
-
@wasmer/wasi
- WASI Implementation for Node and Browsers. -
@wasmer/wasmfs
- WASI/Wasm FileSystem to be used in browsers, or for sandboxing in Node. -
@wasmer/wasm-transformer
- the Javascript interface for thewasm_transformer
crate -
@wasmer/wasm-terminal
- A terminal/shell for interacting with WASI/Wasm Modules that runs in the browser.
Wasm Terminal Example
Contributing
For additional contribution guidelines, please see our CONTRIBUTING.md and our Code of Conduct.
Quick Start
To get started contributing to wasmer-js, create your own fork of the wasmer-js repository by clicking "Fork" in the Web UI.
-
Download / Clone your fork to a local repository. Navigate into the project directory.
-
Install the dependencies with
npm install
. NOTE: This will runlerna bootstrap
, and build the neccessary JS Packages. -
Run
npm run build
. It will bundle JS Packages into './dist' directory. -
Run
npm run dev
, which will serve theexamples/wasm-shell
example, which can be accessed with: http://localhost:8000/examples/wasm-shell/index.html
To make changes to any of the sub projects, they can be tested by either: Running their local tests with npm run test
in their respective package directory, or by running their watch for changes developement command with npm run dev
.
Using Lerna
Please see the website for lerna for a quick introduction into what it is. Here are some general notes about using lerna in this project:
-
Packages can be added by simply creating a new directory within the
packages/
directory, and runningnpm init
in this new package directory. Then, the new package must be botstraped using learna. For this project, this can be done runningnpm run lerna:bootstrap
in the base project directory. -
To add new dependencies and keep build times low,
devDependencies
(not CLI dependencies) must be added to the root package.json file. Project installation / runtime dependencies are managed for each package individually. -
Sibling JS packages can depend on one another. You can do this by using @lerna/add. For example,
lerna add @wasmer/package-1 --scope=@wasmer/package-2
will add @wasmer/package-1@^1.0.0 to @wasmer/package-2