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

@antjs.org/wasm

v0.0.2

Published

Use the Ant Silver JavaScript engine through WebAssembly

Readme

@antjs.org/wasm

Embed the Ant Silver interpreter for sandboxing using WASM. Each Ant instance owns its WebAssembly memory and keeps its own global state.

import { Ant } from '@antjs.org/wasm';

const ant = await Ant.create();
try {
  const result = await ant.eval(`
    Array.from({ length: 5 }, (_, i) => i ** 2)
  `);
  console.log(result); // [0, 1, 4, 9, 16]
} finally {
  ant.dispose();
}

Configure a hard memory ceiling, a guest execution timeout, and synchronous host functions at creation time:

import { Ant } from '@antjs.org/wasm';

const ant = await Ant.create({
  memoryLimit: 64 * 1024 * 1024,
  timeout: 1_000,
  globals: { greet: name => `Hello, ${name}!` }
});

try {
  const value = await ant.eval(`greet("Silver")`);
  console.log(value); // Hello, Silver!
} finally {
  ant.dispose();
}

API

Ant.create(options?) asynchronously instantiates a fresh engine. The default memory limit is 128 MiB. The minimum is 32 MiB and WebAssembly applies the limit in 64 KiB pages, so memoryLimit must be page-aligned. A timeout of 0 (the default) disables the execution deadline.

ant.eval(source) evaluates source with persistent global state and returns a Promise for its completion value. Call dispose() when explicit resource management syntax is not available. On runtimes that implement explicit resource management, using ant = await Ant.create() disposes automatically.

Numbers (including non-finite values and negative zero), booleans, strings, BigInts, null, undefined, arrays, and enumerable string-keyed object data cross the boundary. Cycles, symbols, and nested functions are rejected. A function supplied directly in globals can be called by guest code, but it must return synchronously. Guest module imports, native APIs, subprocesses, networking, the package manager, and JIT compilation are not part of this interpreter-only build.

Promise reactions and resolved await continuations run at the evaluation checkpoint. Promise objects themselves cannot cross the host boundary, and this package does not provide timers or external asynchronous I/O inside the guest.

The timeout interrupts Silver bytecode execution. It cannot preempt a host callback while that callback is running on the same JavaScript thread. Put an instance in a Web Worker when the embedding must also isolate host callbacks from the page's main thread.

Examples

The examples gallery covers basic evaluation, host functions, state isolation, a rules-engine pattern, limits, and error handling. In a repository checkout, build once and then run all Node examples:

npm run build
npm run examples

Build

npm run build

Run npm test for package validation.

The build downloads the host build of wasi-sdk 34, verifies its SHA-256 digest, and compiles a wasm32-wasip1 reactor with Clang and wasm-ld. Set WASI_SDK_PATH to use an existing wasi-sdk 34 installation. Generated build, cache, and package artifacts stay under this package and are ignored by Git.

The published package contains the stripped ant.wasm, the Ant-owned ESM loader, and declarations. It contains no Emscripten loader. The build rejects any unreviewed Wasm import or export; the retained WASI Preview 1 calls are a small libc subset implemented by the loader without filesystem preopens or environment access.

Serve ant.wasm with Content-Type: application/wasm for streaming browser compilation. The loader falls back to buffered compilation when that MIME type is unavailable.