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

secretshield

v1.1.0

Published

πŸ›‘οΈ SecretShield is a CLI tool that detects API keys and sensitive credentials before you commit code.

Readme

πŸ”’ SecretShield

Secure your commits before they go public!

SecretShield is a powerful, blazing-fast CLI tool to scan your codebase for hardcoded secrets like API keys, tokens, database passwords, and more. Avoid accidental leaks and secure your development workflow in seconds.


npm license issues downloads


πŸš€ Features

  • πŸ” Comprehensive scanning of staged files for sensitive data
  • 🧠 Detects over 127+ secret patterns
  • ⚑ Fast and efficient CLI execution
  • 🎨 Colorful logs using Chalk
  • πŸ”„ Easy integration with Git hooks and CI/CD
  • πŸ” Prevents accidental commits of secrets

πŸ“¦ Installation

You can install SecretShield globally or use it with npx.

Option 1 – Run directly without install:

npx secret-shield

Option 2 – Install globally:

npm install -g secret-shield

Option 3 – Install locally (for projects):

npm install --save-dev secret-shield

πŸ› οΈ How to Use

Once installed, simply run:

npx secret-shield

Or, if installed globally:

secretshield

This will scan your staged files (those added via git add) for any potential secrets.

Example Output

βœ… SecretShield CLI is working!
πŸ” SecretShield scanning staged files...
πŸ“‚ Files to scan: [ './.env', './app.js' ]
🚨 Possible secret found in ./app.js at line 12
πŸ”Ž Matched Line: API_KEY="sk_live_1234567890abcdef"
❌ Commit blocked. Secrets detected!

🧠 Supported Secret Patterns

SecretShield currently detects over 127 patterns across multiple categories:

πŸ”‘ Authentication & Security

  • βœ… API Keys (Google, Twitter, Facebook, etc.)
  • βœ… JWT and OAuth Tokens
  • βœ… 2FA/MFA Secrets
  • βœ… PGP/GPG Keys
  • βœ… SSH Private Keys
  • βœ… SSL Certificates

☁️ Cloud Services

  • βœ… AWS (Access Keys, Secret Keys, Session Tokens)
  • βœ… Azure (Keys, Secrets, Tokens)
  • βœ… Google Cloud Platform
  • βœ… Firebase & Supabase
  • βœ… Vercel & Netlify
  • βœ… Digital Ocean, Heroku, Vultr, Linode
  • βœ… Alibaba Cloud, Oracle Cloud, IBM Cloud

πŸ’Ύ Database & Storage

  • βœ… MongoDB, MySQL, PostgreSQL
  • βœ… Redis, RabbitMQ, Cassandra
  • βœ… Elasticsearch, Neo4j
  • βœ… S3, CloudFront, Rackspace
  • βœ… Backblaze Storage

πŸ’³ Payment Processing

  • βœ… Stripe (Secret & Publishable Keys)
  • βœ… PayPal (Client ID & Secret)
  • βœ… Square, Braintree, Adyen
  • βœ… Klarna, Wise

πŸ“± Social Media & Communication

  • βœ… Twitter, Facebook, Instagram
  • βœ… LinkedIn, Discord, Telegram
  • βœ… Slack, TikTok, Pinterest
  • βœ… Twitch, Reddit, Snapchat

πŸ“§ Email Services

  • βœ… SendGrid, Mailchimp
  • βœ… Mailgun, Postmark
  • βœ… Amazon SES, SparkPost
  • βœ… SMTP Credentials

πŸ› οΈ DevOps & Infrastructure

  • βœ… Docker, Kubernetes
  • βœ… GitHub, GitLab, Bitbucket
  • βœ… Jenkins, Travis CI, CircleCI
  • βœ… Ansible Vault, Terraform
  • βœ… Cloudflare

πŸ“Š Analytics & Monitoring

  • βœ… Mixpanel, Segment
  • βœ… Amplitude, Datadog
  • βœ… New Relic

πŸ” Search & Cache

  • βœ… Algolia, Elastic
  • βœ… Memcached

πŸ—ΊοΈ Maps & Location

  • βœ… Google Maps
  • βœ… Mapbox, TomTom

πŸ“ž SMS & Voice

  • βœ… Twilio (Auth Token, Account SID)
  • βœ… Nexmo (Vonage)
  • βœ… Plivo, Sinch

πŸ”„ Generic Patterns

  • βœ… Connection Strings
  • βœ… Credential URLs
  • βœ… Generic Secrets & Keys
  • βœ… Private Key Files

πŸ”§ You can also customize the regex for your org in future versions!


πŸ”„ Git Hook Setup (Optional)

Add this to your pre-commit hook:

#!/bin/sh
npx secret-shield
if [ $? -ne 0 ]; then
  echo "❌ SecretShield blocked your commit!"
  exit 1
fi

Or use tools like husky to integrate it smoothly into your dev workflow.


πŸ›‘οΈ Security

If you discover a vulnerability or a false negative, please do not report it publicly. Instead, reach out securely: πŸ“§ [email protected]


🚫 Ignoring Specific Lines

If you need to ignore a specific line that contains a secret (for example, if it's a test value or a public key), you can add a special comment to that line. SecretShield will skip any line that contains this comment.

Supported Comment Formats:

const API_KEY = "test-key-123"; // secretshield: safe to push
const DB_PASSWORD = "test-pass-456"; /* secretshield: safe to push */
const SECRET_TOKEN = "test-token-789"; /*secretshield: safe to push */
const AUTH_KEY = "test-auth-012"; //secretshield: safe to push

⚠️ Important: Use this feature carefully and only for legitimate cases where the secret is safe to commit (like test values, public keys, or intentionally public tokens).


πŸ§‘β€πŸ’» Author

Arunq Singh Pundir GitHub – @Arunsinghpundir


πŸ“ƒ License

Licensed under the MIT License


🌟 Support the Project

If you find SecretShield useful:

  • ⭐ Star the repo on GitHub
  • πŸ“’ Share it with your developer friends
  • πŸ’¬ Suggest improvements or contribute!

β€œThe best time to protect secrets was yesterday. The second best time is now.” πŸ”