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

@ppoll/npm-audit

v2.0.0

Published

Run npm audit and fail on high/critical vulnerabilities unless explicitly accepted

Readme

@ppoll/npm-audit

npm version npm downloads

A zero-dependency CLI tool that runs npm audit and fails if there are any high or critical vulnerabilities, unless they are explicitly accepted in a configuration file. Designed for CI/CD pipelines to enforce security policies while allowing teams to acknowledge and track accepted risks.

Features

  • Zero dependencies - Only uses Node.js built-in modules
  • Supply chain protection - Run before npm install to audit your lock file before any potentially compromised packages are installed
  • Configurable severity levels - Fail on high/critical (default) or adjust to your needs
  • Accept known vulnerabilities - Document accepted risks with reasons, ownership, and expiration dates
  • CI/CD ready - Works with GitHub Actions, Azure DevOps, and any CI system

Usage

The recommended way to use this tool is with npx, which downloads and runs it directly without installing:

npx @ppoll/npm-audit@latest

This will:

  1. Run npm audit to check for vulnerabilities
  2. If high or critical vulnerabilities are found, check against your accepted vulnerabilities config
  3. Exit with code 0 if no issues or all issues are accepted
  4. Exit with code 1 if there are unaccepted high/critical vulnerabilities

Options

npx @ppoll/npm-audit@latest [options]

Options:
  --config, -c    Path to config file (default: .npm-audit-accept.json)
  --level, -l     Minimum severity level to fail on (default: high)
                  Options: low, moderate, high, critical
  --help, -h      Show help
  --version, -v   Show version

Configuration

Create a .npm-audit-accept.json file in your project root to accept known vulnerabilities:

{
  "acceptedVulnerabilities": [
    {
      "url": "https://github.com/advisories/GHSA-xxxx-xxxx-xxxx",
      "reason": "No fix available, mitigated by input validation",
      "acceptedBy": "[email protected]",
      "acceptedAt": "2026-02-09T00:00:00.000Z",
      "expiresAt": "2026-08-09T00:00:00.000Z"
    }
  ]
}

Configuration Fields

| Field | Required | Description | | ------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | url | Yes | The GitHub advisory URL (e.g., https://github.com/advisories/GHSA-xxxx-xxxx-xxxx). Stable across npm audit runs, unlike vulnerability IDs. | | id | No | The vulnerability ID from npm audit. Deprecated (kept for reference, but not used for matching) | | reason | Yes | Why this vulnerability is being accepted | | acceptedBy | Yes | Who accepted this vulnerability | | acceptedAt | Yes | When this vulnerability was accepted (ISO 8601) | | expiresAt | No | When this acceptance expires (ISO 8601). If expired, the vulnerability will cause a failure again. |

Migrating from v1 to v2

v2.0.0 introduces a breaking change: matching is now based on advisory URLs instead of vulnerability IDs.

Why? npm audit's vulnerability IDs change between runs (same advisory different ID). Advisory URLs (GHSA-*) are stable.

Migration steps:

  1. Run npx @ppoll/npm-audit@latest with your old config
  2. Copy the advisory URLs from the suggestion output
  3. Update .npm-audit-accept.json to use url as the key instead of id

Example:

{
  "acceptedVulnerabilities": [
    {
      "url": "https://github.com/advisories/GHSA-7r86-cg39-jmmj",
      "reason": "Investigating fix availability",
      "acceptedBy": "[email protected]",
      "acceptedAt": "2026-03-19T00:00:00.000Z",
      "expiresAt": "2026-04-19T00:00:00.000Z"
    }
  ]
}

The id field is now optional and preserved for reference, but is no longer used for matching.

CI/CD Integration

The key benefit of this tool is that npx can download and run it directly from npm before installing your project dependencies. This protects against supply chain attacks by auditing the lock file before any potentially compromised packages are installed.

GitHub Actions

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'

      - name: Security audit (before install)
        run: npx @ppoll/npm-audit@latest

      - name: Install dependencies
        run: npm ci

Azure DevOps Pipelines

trigger:
  - main

pool:
  vmImage: 'ubuntu-latest'

steps:
  - task: NodeTool@0
    inputs:
      versionSpec: '20.x'
    displayName: 'Install Node.js'

  - script: npx @ppoll/npm-audit@latest
    displayName: 'Security audit (before install)'

  - script: npm ci
    displayName: 'Install dependencies'

With Custom Configuration

steps:
  - task: NodeTool@0
    inputs:
      versionSpec: '20.x'
    displayName: 'Install Node.js'

  - script: npx @ppoll/npm-audit --config security/audit-exceptions.json --level critical
    displayName: 'Security audit (critical only)'

  - script: npm ci
    displayName: 'Install dependencies'

As a Separate Stage

stages:
  - stage: Security
    displayName: 'Security Checks'
    jobs:
      - job: Audit
        displayName: 'NPM Audit'
        pool:
          vmImage: 'ubuntu-latest'
        steps:
          - task: NodeTool@0
            inputs:
              versionSpec: '20.x'

          - script: npx @ppoll/npm-audit@latest
            displayName: 'Run security audit'
            continueOnError: false

          - script: npm ci
            displayName: 'Install dependencies'

Example Output

When vulnerabilities are found:

🔍 Running npm audit...

⚠️  Found vulnerabilities at high level or above.

📋 Loading accepted vulnerabilities from .npm-audit-accept.json...

❌ Found 2 unaccepted vulnerabilities:

  HIGH: fast-xml-parser - fast-xml-parser has RangeError DoS Numeric Entities Bug
    ID: 1112708
    URL: https://github.com/advisories/GHSA-37qj-frw5-hhjh

  HIGH: next - Next.js self-hosted applications vulnerable to DoS
    ID: 1112593
    URL: https://github.com/advisories/GHSA-9g9p-9gw9-jx7f

To accept these vulnerabilities, add them to .npm-audit-accept.json:

{
  "acceptedVulnerabilities": [
    {
      "id": 1112708,
      "reason": "TODO: Add reason for accepting",
      "acceptedBy": "[email protected]",
      "acceptedAt": "2026-02-09T09:21:06.871Z"
    },
    ...
  ]
}

When all vulnerabilities are accepted:

🔍 Running npm audit...

⚠️  Found vulnerabilities at high level or above.

📋 Loading accepted vulnerabilities from .npm-audit-accept.json...

✅ All vulnerabilities are accepted in configuration.

License

MIT