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

@danny1214/secretsweep

v1.1.1

Published

A fast, dependency-free CLI to scan files and directories for leaked secrets (API keys, tokens, private keys, passwords, connection strings).

Readme

secretsweep

A fast, dependency-free CLI to scan files and directories for leaked secrets: API keys, tokens, private keys, passwords, and database connection strings.

What it does

Recursively walks a file or directory and checks every line of every text file against a set of pattern rules (AWS keys, GitHub/Slack/Stripe/Google tokens, JWTs, PEM private key blocks, hardcoded passwords, DB connection strings with embedded credentials), plus an optional high-entropy fallback for values assigned to suspicious-looking variable names (e.g. my_token = "...").

Matched secrets are redacted in all output (first 4 / last 4 characters shown, middle replaced with ...) — the raw secret value is never printed.

Binary files, common vendor/build directories (.git, node_modules, dist, etc.), and files over 5MB are skipped automatically.

Install

npm install -g @danny1214/secretsweep
secretsweep --help

Requires Node.js >= 14. No dependencies.

From source (contributing / local dev only)

git clone <this-repo>
cd secretsweep
chmod +x bin/secretsweep.js
node bin/secretsweep.js --help

Usage

secretsweep <path> [options]

Options:

  • --json — output findings as JSON instead of human-readable text
  • --no-entropy — disable the high-entropy fallback detector (fewer false positives, may miss unknown secret formats)
  • --severity <level> — only show findings at or above this severity: critical, high, medium, low (default: low, shows everything)
  • -h, --help — show help

Exit codes: 0 = no findings, 1 = findings detected, 2 = invalid usage.

Example

$ secretsweep ./test/fixtures
Scanned 2 file(s), skipped 0, total 2.

[CRITICAL] /path/test/fixtures/leaky.txt:5 (private-key-block)
  PEM-format private key block
  match: -----...KEY-----
  context: -----BEGIN RSA PRIVATE KEY-----

[HIGH] /path/test/fixtures/leaky.txt:2 (aws-secret-key)
  ...

Found 5 potential secret(s).

Running tests

npm test

Expected output: 8 passed, 0 failed.

Limits

  • Pattern-based, not perfect. Rules match known secret formats (AWS, GitHub, Slack, Stripe, Google, JWT, PEM keys) plus generic password/API-key/connection-string patterns. Novel or obfuscated secret formats can be missed. This is a triage tool, not a guarantee.
  • False positives are possible, especially from the entropy fallback detector on non-secret high-entropy strings (hashes, encoded IDs, etc.). Use --no-entropy to reduce noise, or --severity high to focus on higher-confidence rule matches.
  • No git history scanning. Only scans the current state of files on disk, not prior commits. A secret that was committed and later removed will not be found by this tool.
  • Line-based matching only. Secrets split across multiple lines (other than the explicitly handled PEM key block) will not be detected.
  • Not a replacement for secret rotation. If secretsweep finds something, treat the credential as compromised and rotate it — don't just remove it from the file.

License

MIT