Giter VIP home page Giter VIP logo

as-wasi's Introduction

as-wasi

npm version npm downloads per month GitHub License

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 "wasi";

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

// 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:

  • FileSystem - Reading and Writing the user's fileystem. ๐Ÿ“
  • Console - General logging to stdout and stderr. ๐Ÿ–ฅ๏ธ
  • Environ - Accessing environment variables, command flags, etc... ๐ŸŒ
  • Date - Getting the current system time. ๐Ÿ“…
  • Random - Accessing random numbers. ๐Ÿค”
  • Time - Allow sleeping and waiting for events to occur. โฐ
  • And More! See the Reference API in the next section for the full API.

Reference API Docs

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

Projects using as-wasi

  • wasmboy - Game Boy / Game Boy Color Emulator Library, ๐ŸŽฎwritten for WebAssembly using AssemblyScript. ๐Ÿš€
  • wasmerio/io-devices-lib - Library for interacting with the Wasmer Experimental IO Devices API. Uses WASI for outputting graphics in a framebuffer, and handles mouse/keyboard input.
  • wasm-by-example - Wasm By Example is a website with a set of hands-on introduction examples and tutorials for WebAssembly (Wasm). Wasm By Example features as-wasi by default for the AssemblyScript WASI examples.
  • wasm-matrix - A Matrix effect in your terminal using AssemblyScript ๐Ÿš€ and WASI ๐Ÿงฉ . This project is a bit older, and uses an older version of as-wasi, but still creates a cool effect!

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. ๐Ÿ“

as-wasi's People

Contributors

austinfrey avatar bnjbvr avatar dependabot-preview[bot] avatar jedisct1 avatar maxgraey avatar mendyberger avatar mhonert avatar radu-matei avatar torch2424 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.