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

romdev-m2c

v0.1.0

Published

m2c (MIPS/PowerPC/ARM/SuperH to C decompiler) ported to plain JavaScript ESM, for romdev. Output is byte-identical to upstream m2c at the pinned commit.

Readme

romdev-m2c

A plain JavaScript (ESM) port of m2c, the MIPS/PowerPC/ARM/SuperH to C decompiler used by matching-decompilation projects. It takes the same flags as upstream's command line and prints the same C. No Python is needed.

It is part of romdev and is kept in its own package so that m2c's GPL terms stay separate from romdev's MIT code, which only calls it.

Upstream and license

  • Upstream: m2c, https://github.com/matt-kempster/m2c
  • Ported from commit 1d1c4454a445326541305f83f2b0cb680a9ecb2d
  • License: GPL-3.0-only (a derivative of m2c). See LICENSE and NOTICE.
  • src/*.js translate m2c/*.py module by module; m2c_macros.h is copied unchanged. The CodeWarrior demangler is based on arookas' demangler.cs (BSD-3-Clause, notice kept in the source file).
  • The C parser is the separate romdev-pycparser package. --visualize SVG output uses the @viz-js/viz dependency (Graphviz compiled to WebAssembly, EPL-1.0), which runs as a separate program on the dot text m2c produces.

The end-to-end tests run upstream's tests/end_to_end corpus through the port and compare each result byte for byte with upstream's expected output.

How romdev uses it

romdevtools' decomp tool calls it to produce a first C candidate for a function: decomp({op:'generate', ...}) runs m2c on the function's assembly with the translation unit's type context, and decomp({op:'compare'}) then compiles that candidate with the project's original compiler.

Command line

npx romdev-m2c --target mips-ido-c --context ctx.c func.s

The bin is romdev-m2c. It accepts upstream m2c's flags, writes the same stdout and stderr, and exits with the same code.

API

import { decompile, decompileInWorker, UPSTREAM } from "romdev-m2c";

const { code, stdout, stderr } = await decompile([
  "--target", "mips-ido-c", "--context", "ctx.c", "func.s",
]);
  • decompile(flags): runs m2c in process with upstream's CLI flags and resolves to { code, stdout, stderr }. Assembly inputs may also be passed inline as { name, text } objects.
  • decompileInWorker(flags, { timeoutMs }): the same in a worker thread; resolves to { code, stdout, stderr, timedOut } and terminates the worker on timeout.
  • parse_flags, run, ArgumentError: lower-level entry points.
  • UPSTREAM: { repo, commit } of the ported m2c.

Exports: . and ./m2c_macros.h (the header m2c's output expects).

Requirements

Node >= 24, ESM only. No Python, no native code.

Versions

romdev-m2c 0.1.0 ports m2c at commit 1d1c4454.