Home

Awesome

as-wasi

<!--- Badges -->

npm version npm downloads per month GitHub License

<!--- Short Description-->

A high-level AssemblyScript layer for the WebAssembly System Interface (WASI). ๐Ÿงฉ

WASI is an API providing access to the external world to WebAssembly modules. AssemblyScript exposes the low-level WASI standard set of system calls. as-wasi builds a higher level API on top of the AssemblyScript WASI interface, at a similar level to the Node API. ๐Ÿš€

Installation

You can install as-wasi in your project by running the following:

npm install --save as-wasi

Quick Start

Example usage of the Console and Environ classes:

// Import from the installed as-wasi package
import { Console, Environ } from "as-wasi/assembly";

// Create an environ instance
let env = new Environ();

// Get the HOME Environment variable
let home = env.get("HOME")!;

// Log the HOME string to stdout
Console.log(home);

Here are some exported classes that are commonly used:

Reference API Docs

Reference API documentation can be found in REFERENCE_API_DOCS. Documentation is generated using typedoc.

Projects using as-wasi

If your project is using as-wasi, and you would like to be featured here. Please open a pull request against the README with links to your project, and if appropriate, explaining how as-wasi is being used. ๐Ÿ˜Š

Contributing

Contributions are definitely welcome! Feel free to open a PR for small fixes such as typos and things. Larger fixes, or new features should start out as an issue for discussion, in which then a PR should be made. ๐Ÿฅณ

This project will also adhere to the AssemblyScript Code of Conduct.

License

MIT. ๐Ÿ“