WebAssembly.sh - An Online WebAssembly Terminal

WebAssembly.sh - An Online WebAssembly Terminal

WebAssembly.sh - An online WebAssembly Terminal to run WASI modules directly on your browser

Just last week we released Wasmer-JS, a collection of open-source installable packages for running WASI modules in Node and the browser.

📣 Today, with the back-to-back announcement, we are excited to announce WebAssembly.sh.

WebAssembly.sh - An Online WebAssembly Terminal

WebAssembly.sh is an open-source and installable Progressive Web App (PWA) terminal fully powered by WebAssembly and Wasmer-JS, that uses the WebAssembly Package Manager and local files to run server-side Wasm WASI modules in a shell-like interface 🖥

We are stoked to share WebAssembly.sh, because we feel like it has a lot to offer for a variety of use cases:

The goals of WASI go far beyond CLI-styled applications. However, the current API supports them and we are excited to introduce these use cases today for the community!

Let’s take a step back, and see how we can use WebAssembly.sh. 🤔

Using WebAssembly.sh

Let’s take a quick walkthrough of WebAssembly.sh.

On first load (~200KB) you will be greeted with a welcome message. But behind the scenes, all of the PWA magic happens. The service worker will be installed, and now WebAssembly.sh will work offline. 🤯

You will also notice WebAssembly.sh can be installed natively either through the “_Add to HomeScreen_” on mobile, or the install icon in the URL bar on Desktop browsers. All of this functionality can be confirmed and investigated through your browser’s developers tool. In particular we used Chrome’s Lighthouse Audit to help us build for / enable the PWA features in WebAssembly.sh. 💡

WebAssembly.sh - An Online WebAssembly Terminal

Let’s get started running some commands!

When WebAssembly.sh tries to run a command, first it will check if the WASI-compiled module is already installed and cached. If not, WebAssembly.sh will default to searching on WAPM to then download and run that module. ⚡

Let’s say we take a look at the available WASI packages on WAPM, and we decide to run quickjs (docs) to evaluate Javascript through their WASI compiled engine. Thus, we would enter the command quickjs, and then you should be able to start using the engine! WebAssembly.sh - An Online WebAssembly Terminal

Next, let’s upload and run our own custom WASI modules. For this, we can use the package manager for WebAssembly.sh, wapm.

️WAPM on WebAssembly.sh, is a command to manage Wasm Modules. It is intended to behave similar to the native WAPM Package Manager. Using the command wapm upload , a file upload dialog will show up, allowing you to upload your own .wasm file to be installed as a command. For example, if we install mywasi.wasm using wapm upload , then you can run the command mywasi to run the Wasm / WASI module.

Wapm also supports other functions such as: wapm install to manually install a package and/or a package version from Wapm, wapm list to list all available commands, and wapm uninstall to delete a command installed by Wapm. Another nice feature is that the commands installed by Wapm are saved to IndexedDB using idb-keyval so that installed modules work between sessions, and even work offline! 📦

WebAssembly.sh - An Online WebAssembly Terminal

We can also get Wasm modules to work with one another! Similar to a Unix environment, WebAssembly.sh supports piping. It uses Comlink in the background, to spin up multiple workers and passed standard input and standard output between them. Using the example we mentioned earlier in the article, we can run cowsay WebAssembly | lolcat , and we get a colorful cowsay shown in our terminal! 🐄🌈

WebAssembly.sh - An Online WebAssembly Terminal

With that short introduction, you should be able to hit the ground running with WebAssembly.sh! 🏃

Thank you!

We are super excited to see how people use WebAssembly.sh, and we hope you enjoy using it as much as we did making it. 😄

As mentioned in the Wasmer-JS announcement, this is possible due to a lot of awesome open source projects in the JavaScript and WebAssembly community. Another huge thank you to the authors of node-wasi, wasm-pack, memfs, Xterm.js, Comlink, and the other dependencies we are building on top of! 🙏

We are working to bring features like Filesystem Access (both in the browser using memfs, and natively through something like Electron), additional caching for more offline support, and much more!

WebAssembly pwa web-development

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Hire Web Developer

Looking for an attractive & user-friendly web developer? HourlyDeveloper.io, a leading web, and mobile app development company, offers web developers for hire through flexible engagement models. You can **[Hire Web...

Top PWA Development Companies 2020 – TopDevelopers.co

Find the best PWA App Developers, to choose from a well-researched list of top PWA development companies and help you to develop Progressive Web Apps for your business.

Why Web Development is Important for your Business

With the rapid development in technology, the old ways to do business have changed completely. A lot more advanced and developed ways are ...

Important Reasons to Hire a Professional Web Development Company

    You name the business and I will tell you how web development can help you promote your business. If it is a startup or you seeking some...

Hire Dedicated eCommerce Web Developers | Top eCommerce Web Designers

Build your eCommerce project by hiring our expert eCommerce Website developers. Our Dedicated Web Designers develop powerful & robust website in a short span of time.