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

defuscator

v1.0.1

Published

Static JavaScript deobfuscation and risk triage. Unpacks obfuscator.io string arrays, P.A.C.K.E.R., JSFuck, JJEncode and source maps, and emits JSON or SARIF - without ever executing the analyzed code.

Readme

defuscator

Static JavaScript deobfuscation and risk triage from the command line. The analysed code is never executed.

npx defuscator suspicious.js

No .NET, no runtime to install: the package pulls one prebuilt binary for your platform.

What it takes apart

  • obfuscator.io / javascript-obfuscator - string arrays with rotation, base64 and RC4 encodings, function and variable wrappers, every identifier style, and calls transformed into decoder lookups
  • Dean Edwards P.A.C.K.E.R. - eval(function(p,a,c,k,e,d){...}), base62 and plain
  • JSFuck, JJEncode, AAEncode
  • Hex and unicode escapes, control-flow flattening, proxy objects, opaque predicates
  • Source maps, including inline sourceMappingURL payloads

Usage

defuscator <file.js> [options]
cat file.js | defuscator [options]

  --json          Emit the full analysis as JSON.
  --sarif         Emit SARIF 2.1.0 for GitHub code scanning or a SOC pipeline.
  --decode-only   Print only the decoded, beautified output.
  --sourcemap     Recover original sources from an inline source map.
  --obfuscate     Obfuscate the input instead of analysing it.
  --gate=risk     Base the exit code on capability risk instead of obfuscation.
  -h, --help

Exit codes

0 none/low, 1 medium, 2 high (score 68 or above) - so it can gate a build directly:

defuscator bundle.js || echo "flagged"

By default the exit code tracks the obfuscation score, which is what a build gate wants. An ordinary minified library scores 0 for obfuscation but high for capability, because it calls setTimeout and touches the DOM. Use --gate=risk to gate on capability instead - the right choice when triaging an unknown sample rather than guarding a build.

Two scores, and why

  • Obfuscation - how hard the code is trying not to be read. Measured on the original source, because deobfuscating it is what destroys the evidence.
  • Capability risk - what the code would do if it ran. Measured on the decoded output, because that is where a call hidden behind a lookup table finally becomes visible.

They answer different questions and are not interchangeable. A heavily obfuscated file with a low risk score is not necessarily safe - it may simply not be fully resolved yet.

In CI

There is a GitHub Action that wraps this and uploads SARIF to code scanning:

- uses: defuscator/defuscator-action@v1
  with:
    paths: src

Benchmark

The engine is measured by a public, reproducible benchmark that scores decoded output by running it and comparing behaviour, including the cases it still fails: https://github.com/defuscator/deobfuscation-benchmark

Links

MIT licensed.