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-pycparser

v0.1.0

Published

Plain-JS port of pycparser (the m2c / decomp-permuter fork with GCC extensions): C99 lexer, LALR parser on upstream's own tables, AST and C generator that round-trip like upstream.

Readme

romdev-pycparser

A plain JavaScript (ESM) port of pycparser as vendored by m2c (m2c_pycparser) and decomp-permuter (perm_pycparser): pycparser 2.23 with GCC extensions (attributes, asm, typeof and more). It has the C99 lexer, an LALR parser driven by upstream's own parse tables, the AST and the C generator, and round-trips C the way upstream does. No Python is needed.

It is part of romdev.

Upstream and license

  • Upstream: pycparser 2.23 (Eli Bendersky), https://github.com/eliben/pycparser, as patched in m2c commit 1d1c4454a445326541305f83f2b0cb680a9ecb2d and decomp-permuter commit 41bd0bfc32aa5ea78de4cf28be603163256c2a4c (the two vendored copies are the same files under two package names).
  • The lexer and parse loop follow PLY 3.10 (David M. Beazley).
  • License: BSD-3-Clause (pycparser and PLY). Full texts in LICENSE; details in NOTICE.
  • src/tables/*.json are converted from upstream's lextab.py, yacctab.py and c_ast.py by a JS script that reads them as Python literals.

How romdev uses it

It is the C parser and printer under romdev-m2c (m2c reads type context with it) and romdev-permuter (the permuter parses, mutates and prints candidate C with it). Both are driven by romdevtools' decomp tool (decomp({op:'generate'}) and decomp({op:'search'})).

API

import { CParser, CGenerator, c_ast } from "romdev-pycparser";

const ast = new CParser().parse("int add(int a, int b) { return a + b; }", "<source>");
const text = new CGenerator().visit(ast);

Exports from .: CParser, CLexer, CGenerator, the c_ast namespace (Node, NodeVisitor, every node class), parse_file, the AST transforms (fix_switch_cases, fix_atomic_specifiers) and the error classes (ParseError, LexError). parse_file never runs a host cpp: pass already-preprocessed C, or a preprocess function.

Requirements

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

Versions

romdev-pycparser 0.1.0 ports pycparser 2.23 as vendored by m2c and decomp-permuter at the commits above.