npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

was

v1.0.31

Published

WebAssembly assembler JavaScript (libwabt.js) wrapper

Readme

was

WebAssembly assembler JavaScript (libwabt.js) wrapper

Install

To install was, you may use the npm package manager.

	npm install -g was

If you are using Linux or Mac, you might want to add sudo to installation.

Usage

was can assemble, disassemlbe and run webassembly modules.

It also include an io library so writing wasm programs is made easier.

Assemble

	was program.wat

This will generate a file with the name program.wasm.

You may use several options:

| Option | Short | Description | |--------|-------|-------------| | --debug | -d | Add debug information to the wasm binary. This will add a section with the function, variables, table and label names | | --log | -l | Write a log about the compiled binary file | | --output | -o | The name of the output file. If it is not specified, the name of the input file will be used and the extension will be changed to wasm |

Disassemble

	was disassemble program.wasm

This will generate a file with the name program.wat.

You may use several options:

| Option | Short | Description | |--------|-------|-------------| | --debug | -d | Load the debug information (if it exists) from the wasm binary. This will load the section with the function, variables, table and label names | | --names | -n | Generate names for the functions, variable, tables and labels. usually this is used if the debug information is not present. | | --inline-export | -e | Write the export statements inside the exported element. The default option is to write the export as a separate statement | | --fold | -f | Fold expresssion | | --output | -o | The name of the output file. If it is not specified, the name of the input file will be used and the extension will be changed to wat |

Run

	was run program.wasm

This will run the program.wasm program using Node.

You may use several options:

| Option | Short | Description | |--------|-------|-------------| | --import | -i | Load a Node module and allow the WebAssembly program to import it. The module may be imported by webassembly using the file name (without extension). All the exprted items from the module are made available to the WebAssembly program. You may write several import items in the command line. | | --memory | -m | The format is minPages:maxPages. Set up a memory space with a minimum number of minPages and a maximum number of maxPages. A memory page is 64 KB of storage |

Libraries

These libraries are automatically imported when running a WebAssembly program with wasm.

io

The io library provides simple input and output functions.

| Function | Import Statement | Descriptions | |----------|------------|--------------| | mem | (import "io" "mem" (memory _minPage_)) | The memory (if it was set with the --memory option). minPage is the minimum number of pages specified | | readstr | (import "io" "readstr" (func $readstr (param $strAddr i32) (param $length i32) (result i32))) | Reads a string from the standard input and writes it into the memory. The reading is stopped when the return key is pressed, maximum $length bytes are written to the memory. A \0 character is added to the buffer. $strAddr is the memory location where the string will be written. The function returns the number of charcters read (without the \0) | | readchar | (import "io" "readchar" (func $readchar (result i32))) | Reads a charcter from the standard input and returns it | | readint | (import "io" "readint" (func $readint (result i32))) | Reads a signed integer from the standard input and returns it | | writestr | (import "io" "writestr" (func $writestr (param $strAddr i32))) | Writes a string to the standard output: $strAddr is the address of a null terminated string inside the memory | | writechar | (import "io" "writechar" (func $writechar (param $char i32))) | Writes a charcter to the standard output: _$char is the character | | writeint | (import "io" "writeint" (func $writeint (param $int i32))) | Writes a signed integer to the standard output: _$int is the number |