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

@decompiler/core

v0.0.1

Published

Production-grade reverse engineering toolkit — reconstructs readable source approximations from compiled, minified, or transpiled JavaScript and bytecode.

Readme

@decompiler/core

Production-grade reverse engineering toolkit — reconstructs readable, structured source approximations from minified JavaScript, transpiled output, or bytecode artifacts.

Node.js License: MIT PRs Welcome


Features

  • AST-based decompilation — fault-tolerant JS parsing via Acorn + acorn-loose
  • Code beautification — configurable reformatting with js-beautify + escodegen
  • Symbol renaming — heuristic rename of mangled identifiers to semantic placeholders
  • Pluggable parsers & transformers — extend by adding one file per format
  • CLI interfacedecompiler -i file.min.js -o recovered.js
  • Structured logging — JSON or pretty-print via Winston
  • Jest test suite with coverage thresholds enforced

Quick Start

npm install
npm test
node src/cli/index.js --input fixtures/input/sample.min.js --output fixtures/output/result.js

CLI Usage

Usage: decompiler [options]

Options:
  -i, --input <file>        Input compiled/minified file (required)
  -o, --output <file>       Output path (omit for stdout)
  -p, --parser <name>       javascript | bytecode  [default: javascript]
  -t, --transformer <name>  beautify | rename | full  [default: full]
  -l, --log-level <level>   error | warn | info | debug  [default: info]
  -f, --format <fmt>        pretty | json  [default: pretty]
  -V, --version             Print version
  -h, --help                Show help

Examples

# Decompile a minified bundle
decompiler -i dist/bundle.min.js -o src-recovered/bundle.js

# Beautify only (skip rename heuristics)
decompiler -i lib/util.js -o lib/util.pretty.js --transformer beautify

# Emit raw JSON AST
decompiler -i app.min.js --format json

# Debug logging
decompiler -i file.js --log-level debug

Project Structure

src/
├── index.js                 Public API entry point
├── cli/index.js             Commander-based CLI
├── core/
│   ├── decompiler.js        Orchestration engine
│   └── pipeline.js          Composable transform runner
├── parsers/
│   ├── index.js             Parser registry
│   ├── javascript.js        Acorn fault-tolerant JS parser
│   └── bytecode.js          Bytecode stub (extend here)
├── transformers/
│   ├── index.js             Transformer registry + generator
│   ├── beautifier.js        escodegen + js-beautify
│   └── renamer.js           Heuristic identifier renaming
└── utils/
    ├── logger.js            Winston logger factory
    ├── fileHandler.js       Safe file I/O
    └── validator.js         Input validation
tests/            Mirror of src/ — one test file per module
fixtures/
├── input/sample.min.js      Bundled minified fixture
└── output/                  Git-ignored decompilation output

npm Scripts

| Command | Purpose | |-----------------------|--------------------------------------------------| | npm start | Run CLI (append -- -i file.js for args) | | npm test | Run Jest suite | | npm run test:coverage | Coverage report (thresholds enforced) | | npm run lint | ESLint (zero warnings) | | npm run lint:fix | Auto-fix lint violations | | npm run build | Lint + test gate (CI entry point) |


Extending the Pipeline

Add a parser — create src/parsers/myformat.js:

'use strict';
function parse(source, opts) { /* return ESTree AST */ }
module.exports = { name: 'myformat', parse };

Register in src/parsers/index.js.

Add a transformer — create src/transformers/mytransform.js:

'use strict';
function transform(ast, opts) { /* return AST */ }
module.exports = { name: 'mytransform', transform };

Register in src/transformers/index.js.


License

MIT