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

secure-npm

v1.0.0

Published

Security scanner for Node.js projects with AI-powered suggestions

Readme

SECURE-NPM

🛡️ Protect your Node.js projects with advanced security scanning and AI-powered package recommendations

SECURE-NPM helps you identify and fix security vulnerabilities in your Node.js dependencies with intelligent suggestions for safer alternatives.

SECURE-NPM Node.js License

Why SECURE-NPM?

  • More than just npm audit: Goes beyond basic vulnerability detection
  • AI-powered recommendations: Get smart suggestions for safer alternatives
  • Multiple report formats: Easy-to-read security reports (Markdown, HTML, JSON)
  • Auto-fix capabilities: Automatically update vulnerable packages
  • Zero-cost option: Works completely offline with no API keys required

Quick Start

Installation

# Install globally (recommended)
npm install -g secure-npm

# Run a basic scan
secure-npm scan

Basic Usage

# Scan with free local AI suggestions
secure-npm scan --ai

# Automatically fix vulnerabilities
secure-npm scan --fix

# Generate a security report
secure-npm scan --report

# All features combined
secure-npm scan --ai --fix --report

Features

🔍 Advanced Vulnerability Detection

SECURE-NPM scans your project using multiple detection methods:

  • Direct vulnerabilities in your dependencies
  • Transitive vulnerabilities in the dependency tree
  • Security advisories from the npm registry

🤖 AI-Powered Recommendations

Three levels of AI suggestions to fit your needs:

  1. Free & Offline (--ai flag)

    • Built-in database of 200+ packages with known safer alternatives
    • No API keys or internet connection required
    • Instant recommendations based on vulnerability patterns
  2. Cost-Effective (--huggingface flag)

    • Uses Hugging Face Mistral 7B for enhanced recommendations
    • Only ~$0.0005/1K tokens (70% cheaper than GPT-3.5)
    • Free tier available with generous rate limits
  3. Enterprise-Grade (--openai flag)

    • Leverages OpenAI for most detailed security analysis
    • Provides migration guidance and breaking change considerations
    • Ideal for mission-critical applications

📊 Comprehensive Reports

# Generate a markdown report (default)
secure-npm scan --report

# Generate an HTML report
secure-npm scan --report --output html

# Generate a JSON report for programmatic use
secure-npm scan --report --output json

🔧 Auto-Fix Capabilities

# Automatically upgrade vulnerable packages
secure-npm scan --fix

Command Options

| Option | Description | |--------|-------------| | --ai | Enable free offline AI suggestions | | --huggingface | Use Hugging Face AI (requires token) | | --openai | Use OpenAI (requires API key) | | --fix | Auto-fix vulnerabilities when possible | | --report | Generate a security report | | --output <format> | Report format: markdown, html, or json | | --verbose | Show detailed debug information |

Using AI-Powered Features

Setting API Keys

For Hugging Face or OpenAI integration, set your API keys as environment variables:

Linux/macOS:

export HUGGINGFACE_API_TOKEN="your-token-here"
# or
export OPENAI_API_KEY="your-key-here"

Windows:

set HUGGINGFACE_API_TOKEN=your-token-here
# or
$env:HUGGINGFACE_API_TOKEN="your-token-here"  # PowerShell

Getting API Keys

  • Hugging Face API (Recommended): Sign up here

    • Go to https://huggingface.co/settings/tokens
    • Create a new token with "Read" access
  • OpenAI API: Sign up here

    • Go to https://platform.openai.com/api-keys
    • Create a new API key

CI/CD Integration

Add SECURE-NPM to your GitHub Actions workflow:

name: Security Check

on: [push, pull_request]

jobs:
  security:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: '18'
      - run: npm install -g secure-npm
      - run: secure-npm scan --ai --report --output json

Example Output

Running a scan produces helpful output like this:

📦 Scanning project for vulnerabilities...
🔍 Running npm audit...

📊 SECURE-NPM SCAN RESULTS
══════════════════════════════════

Vulnerability Summary:
Total vulnerable packages: 2
Total vulnerabilities: 3
  Critical: 1
  High: 1
  Moderate: 1
  Low: 0

Vulnerable Packages:

► lodash (critical)
  - Prototype Pollution in lodash
    Recommendation: Update to 4.17.21
  AI Suggestion:
    The prototype pollution vulnerability allows attackers to modify
    properties of the global Object prototype, potentially leading to
    application crashes or remote code execution.

    Alternatives:
      - radash: Smaller bundle size, modern API, fewer vulnerabilities
      - remeda: Functional programming utilities with TypeScript support

► marked (high)
  - Regular Expression Denial of Service
    Recommendation: Update to 15.0.0
  AI Suggestion:
    This ReDoS vulnerability could allow attackers to cause excessive
    CPU consumption, leading to denial of service.

    Alternatives:
      - markdown-it: More secure markdown parser with plugin system
      - remark: Extensible markdown processor with strong security focus

Action Recommended:
Run 'secure-npm scan --fix' to automatically fix vulnerabilities.

License

MIT License - see the LICENSE file for details.