Wasmer-JS is a mono-repo of multiple JavaScript packages enabling easy use of WebAssembly Modules in Node and the Browser.
-
@wasmer/wasi
- WebAssembly WASI implementation for Node and browsers. -
@wasmer/cli
- WebAssembly WASI CLI for Node.js (wasmer-js
) -
@wasmer/wasmfs
- WASI/Wasm FileSystem. -
@wasmer/io-devices
- Implementation Support for the Wasmer Experimental I/O Devices for Wassmer-JS. -
@wasmer/wasm-transformer
- the JS interface for thewasm_transformer
crate -
@wasmer/wasm-terminal
- A browser terminal/shell for interacting with WASI/Wasm Modules. It powers WebAssembly.sh.
Documentation for the Wasmer-JS Stack, can be found on the Wasmer Docs.
Contributing into Wasmer-JS it's very easy, just clone the repo and run:
npm install
NOTE: This will run
lerna bootstrap
, and bootstrap the JS Packages.
To start development mode, you can run the dev
command:
npm run dev
This will serve the examples/wasm-shell
example, which can be accessed with: http://localhost:1234/
To build all the packages in the project, you can run the build
command:
npm run build
This will bundle JS Packages into ./dist
directory.
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 running it the root:
npm run test
For additional contribution guidelines, please see our CONTRIBUTING.md and our Code of Conduct.
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. However, there are issues when a published package tries to depend on a new unpublished package, please see this issue for the discussion. And, one should not be afraid oflearna link convert
, asfile://
dependencies will be automatically converted by lerna on publish, for example see here.