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

wasmx-cli

v0.1.4

Published

Turns WebAssembly binaries into Node.js modules that you can publish to npm

Downloads

45

Readme

Transform WebAssembly binaries into instantly usable Node.js modules

License: MIT Node.js Platform

Package WebAssembly binaries into instantly usable Node.js modules

Table of Contents

Installation

npm install -g wasmx-cli

Usage

Pack Command

Package a WASM file into a Node.js module:

wasmx pack input.wasm [flags]

Available Flags

| Flag | Description | Default | |------|-------------|---------| | -o, --output <dir> | Output directory | pkg | | -e, --embed | Embed WASM as base64 if ≤512KB | External file | | -n, --name <string> | Package name (sanitized to kebab-case) | Filename stem | | -T, --no-types | Skip .d.ts generation | Generate types | | -t, --target <semver> | Minimum Node.js version | 18.0.0 | | -s, --strict | Fail on non-env imports or no exports | Lenient | | -q, --quiet | Suppress stdout, errors to stderr only | Show output | | -f, --force | Overwrite existing output directory | Abort if exists | | -M, --memory-pages <N> | Initial WebAssembly.Memory pages | 256 (clamped 1-65536) | | -c, --change-version <ver> | Set package.json version | 1.0.0 |

Types Command

Generate TypeScript type definitions from WASM exports:

wasmx types input.wasm -o types.d.ts
wasmx types input.wasm -o types.d.ts -m mymodule

Help Command

Show help for the pack command:

wasmx pack-help
# or alias:
wasmx ph

Examples

Basic Packaging

Package WASM with embedded binary:

wasmx pack add.wasm -o pkg -e -n add-wasm

Strict Validation

Package with strict validation (rejects non-env imports):

wasmx pack add.wasm -o pkg --strict --force

Type Generation

Generate standalone type definitions:

wasmx types add.wasm -o types.d.ts

Wrap types in declare module block:

wasmx types add.wasm -o types.d.ts -m add-wasm

Output Structure

Running wasmx pack add.wasm -o pkg -e produces:

pkg/
├── index.js        # CommonJS loader
├── index.mjs       # ESM loader
├── index.d.ts      # TypeScript definitions
├── package.json    # npm metadata
└── module.wasm     # only if not embedded

Both loaders provide runtime WebAssembly.Memory allocation, automatic export name sanitization (e.g. foo-bar becomes _wasm_foo_bar), and zero external dependencies.

Requirements

  • Node.js 16.0.0 or higher
  • ✅ WASM files should use only env imports (use --strict to validate at pack time)
  • ✅ For global installs on Windows: executable must have no file extension (wasmx not wasmx.js) to avoid VS Code hijacking

Limitations

  • ⚠️ TypeScript definitions use generic signatures (...args: number[]) => number instead of precise parameter types
  • ⚠️ Custom imports beyond env.memory require manual loader modification
  • ⚠️ WASM files with non-env imports will fail at runtime unless the host environment provides those imports

License

This project is licensed under the MIT License.


Made with ❤️ for the WebAssembly community