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

debugger-sh

v0.3.3

Published

A browser-based execution engine and debugger powered by WebAssembly

Downloads

1,070

Readme

debugger-sh

A browser-based execution engine powered by WebAssembly. Compile and run C/C++ programs entirely in the browser with a built-in debugger.

Installation

npm install debugger-sh

Requires these response headers (the engine uses SharedArrayBuffer for stdin):

Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Opener-Policy: same-origin

Quick start

import { Engine } from 'debugger-sh';

const engine = await Engine.create('c');

// Virtual filesystem — the program sees these as real files
engine.fs = {
  'main.cpp': `
    #include <iostream>
    int main() {
      std::cout << "Hello, world!" << std::endl;
      return 0;
    }
  `
};

// stdout / stderr chunks arrive as Uint8Array (UTF-8)
const decoder = new TextDecoder();
const print = (chunk: Uint8Array) => process.stdout.write(decoder.decode(chunk));
engine.stdout.on('data', print);
engine.stderr.on('data', print);

await engine.run();

Programs compile in debug mode by default, so a DAP handshake is required before run() will proceed — see the integration guide. To skip it, set engine.debugger.enabled = false.


Full API

const engine = await Engine.create('c'); // 'c' is currently the only supported lang

engine.fs; // DirNode  — virtual filesystem, set before run()
engine.stdout; // Stdout   — .on('data', (chunk: Uint8Array) => …) / .off(...)
engine.stderr; // Stdout
engine.stdin; // Stdin    — .write(string | Uint8Array): Promise<void>
engine.debugger; // Debugger — DAP interface; set .enabled = false to skip the handshake
engine.lang; // Lang

engine.run(); // Promise<RunResult> — { type: 'completed', exitCode } | { type: 'stopped' } | { type: 'error', error }
engine.stop(); // void               — kills the worker; run() resolves with { type: 'stopped' }

engine.debugger.send(message); // DAP request, returns response synchronously
engine.debugger.on('event', fn); // async DAP events
engine.debugger.on('artifact', fn); // download artifacts emitted by the engine

Wiring stdin

engine.stdin.write() accepts a UTF-8 string or Uint8Array. Programs read via cin, scanf, read(), etc.

await engine.stdin.write('42\n');
await engine.stdin.write(new TextEncoder().encode('42\n'));

Example project

For a full reference integration, see the debugger.sh IDE — a Next.js + MUI app wiring up CodeMirror 6, xterm.js, and debugger-sh into a working in-browser IDE.


Contributing / building from source

Requires Cargo 1.91+, wasm-pack, and Node v22+.

cargo install wasm-pack
npm install
npm run build   # wasm-pack build --target web && vite build
npm run dev     # local development

To test against the reference IDE, clone debugger-sh/debugger.sh alongside this repo and link:

npm link                  # in this repo
cd ../debugger.sh
npm link debugger-sh
npm run dev