A terminal-like component for the browser, that fetches and runs Wasm modules in the context of a shell. 🐚
Documentation for Wasmer-JS Stack can be found on the Wasmer Docs.
Table of Contents
- Quick Start
- Wasm Terminal Reference API
- Browser Compatibility
Provides a terminal-like experience, with stuff like autocomplete, hotkeys, pipes, and more! 👩💻
Allows passing in your own custom Wasm binaries, or callback commands to provide commands in the shell! ⚙️
Runs processes in seperate web workers using Comlink! 🔗
Exports a command fetcher for fetching packages from WAPM! 📦
@wasmer/wasm-terminal, just run this command in your shell:
npm install --save @wasmer/wasm-terminal
First, We must also include the
[xterm](https://github.com/xtermjs/xterm.js/).css. For example:
<!-- This includes the external stylesheet. NOTE: The path should point to wherever you are hosting the wasm-terminal output. -->
NOTE: Remember to include the CSS file mentioned at the beginning of the "Quick Start" section.
The Reference API Documentation can be found on the
@wasmer/wasm-terminal Reference API Wasmer Docs.
For more simple Wasm modules, E.g cowsay, the Wasm terminal will work on the latest version of all major browsers. However, more complex Wasm modules may only work on browsers that support SharedArrayBuffer. Which was previously implemented in all major browsers, but was removed due to the Meltdown and Spectre attacks. Though, some major browsers have already started to re-enable this feature. The following cases that may be problemsome are:
Wasm modules that infinitely loop like wasm-matrix. They will block the main thread and freeze the browser.
Wasm modules that take in input from
/dev/stdinsuch as lolcat. They will not take input from the shell. but instead, use
window.promptto get input. Since
The project is split up around the relationship between a terminal, tty, and shell.
This project follows the all-contributors specification.
Contributions of any kind are welcome! 👍