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

@wasm-idle/node

v1.4.0

Published

Node.js host helpers for wasm-idle core

Readme

@wasm-idle/node

Node.js host helpers for wasm-idle sandboxes. They load a sandbox through a @wasm-idle/core playground binding, run one program with optional stdin, stream its output, and clean the sandbox up afterwards.

This package does not include or select runtimes. Pass a loadSandbox function that returns Node-capable Sandbox implementations, or an existing playground binding.

pnpm add @wasm-idle/node @wasm-idle/core

Usage

import { executeWasmIdleInNode, fileAssetUrl, runWasmIdleInNode } from '@wasm-idle/node';
import { loadSandbox } from './sandboxes'; // your Node-capable SandboxLoader

const runtimeAssets = fileAssetUrl('/opt/wasm-idle/runtimes');

// Legacy load/run path: output is streamed, failures are returned rather than thrown.
const run = await runWasmIdleInNode({
	language: 'PYTHON3',
	code: 'print(input().upper())',
	stdin: 'hello\n',
	runtimeAssets,
	loadSandbox
});
if (!run.ok) process.exitCode = 1;

// Structured path: requires a sandbox that implements execute().
const result = await executeWasmIdleInNode({
	language: 'PYTHON3',
	request: { code: 'print(input().upper())', stdin: 'hello\n' },
	runtimeAssets,
	loadSandbox
});
console.log(result.exitCode, result.stdout);

API

  • runWasmIdleInNode(options) loads the sandbox, writes stdin followed by EOF when provided, and runs code. It resolves to { ok, result, elapsedMs, error?, cleanupErrors? }. ok is false when run() returns false or when load() or run() throws. A thrown failure is written to stderr; its message is returned in result and the original error in error. Errors from the loader itself still reject.
  • executeWasmIdleInNode(options) calls the sandbox's structured execute(request) and resolves to its ExecutionResult. It rejects with the original error on failure, or with a NodeExecutionCleanupError (an AggregateError whose cause is the original error) when cleanup also failed. A sandbox without execute() rejects with RuntimeConfigurationError.
  • fileAssetUrl(path) converts a local path into a file: URL string for runtimeAssets.

Options worth knowing

  • Provide either playground (an existing PlaygroundBinding, whose lifetime stays with you) or loadSandbox with optional runtimeAssets.
  • Sandbox output goes to the stdout callback (default process.stdout); failure messages go to the stderr callback (default process.stderr).
  • For runWasmIdleInNode, args, executionOptions, log, and progress are forwarded to the sandbox's load() and run() calls.
  • The sandbox is disposed after each call unless disposeAfterRun: false. runWasmIdleInNode can also clear it first with clearAfterRun: true. Cleanup failures are reported in cleanupErrors instead of replacing a returned result.

See the wasm-idle repository for the runtime contracts and the runtime execution and cleanup contract.