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

bitbucket-audit-report

v1.2.6

Published

Bitbucket Pipelines report for javascript audits.

Readme

bitbucket-audit-report

License

A Bitbucket Pipelines utility that automatically runs pnpm audit --json and posts the security audit results as a Code Insights report and inline annotations directly on your commits and pull requests.

Bitbucket Code Insights Report

Features

  • Pnpm Audit Integration: Designed to work out-of-the-box with pnpm workspace or single-project repositories.
  • Bitbucket Code Insights: Publishes a security report directly to the commit page with high-level summary statistics (vulnerability status, duration, total dependencies checked).
  • Inline Annotations: Highlights each security advisory directly on the package.json file on your Pull Request diffs with detailed fix recommendations, severity, and URLs.
  • Smart Build Failures: Can fail your pipeline builds automatically if vulnerabilities are found that exceed your configured threshold.
  • Highly Configurable: Control maximum acceptable severity, logging filters, and report IDs via standard environment variables.

How It Works

During a Bitbucket Pipelines run, the tool runs pnpm audit --json. It parses the JSON output to extract vulnerabilities, maps them to Bitbucket's report severity values, and pushes the summary and detailed code annotations to Bitbucket's built-in REST API (using Bitbucket’s HTTP proxy server).

Severity Mapping

| pnpm audit Severity | Bitbucket Report Severity | | --------------------- | ------------------------- | | info | LOW | | low | LOW | | moderate | MEDIUM | | high | HIGH | | critical | CRITICAL |


Configuration

This tool is configured entirely using environment variables.

Bitbucket-provided Variables (Required)

The following variables are automatically injected by Bitbucket Pipelines:

  • BITBUCKET_BRANCH
  • BITBUCKET_COMMIT
  • BITBUCKET_REPO_OWNER
  • BITBUCKET_REPO_SLUG

Customization Variables (Optional)

| Variable | Description | Default | | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- | | BPR_LEVEL | Maximum acceptable vulnerability level to consider the build safe. Valid options are info, low, moderate, high, critical. If any vulnerability above this level is found, the build report status is marked as FAILED and the script exits with code 1. | high | | BPR_LOG | Annotation severity floor. If specified, only security advisories at or above this level will be published as inline annotations. Options: info, low, moderate, high, critical. | None (All advisories are annotated) | | BPR_NAME | The title of the Bitbucket Code Insights report. | Security: npm audit | | BPR_ID | The unique ID of the Bitbucket Code Insights report. | npmaudit | | BPR_PROXY | The Bitbucket Pipelines proxy host format. Use local for 127.0.0.1 or pipe for host.docker.internal. | local | | BPR_MAX_BUFFER_SIZE | Maximum process stdout buffer size in bytes for spawning the pnpm audit command (useful for large mono-repos). | 10485760 (10MB) |


Installation & Usage

Make sure pnpm is installed and available in your pipeline execution step environment.

1. In Bitbucket Pipelines (bitbucket-pipelines.yml)

Add the tool as a pipeline step using npx:

image: node:20

pipelines:
  default:
    - step:
        name: Security Audit
        script:
          - corepack enable pnpm
          - pnpm dlx bitbucket-audit-report

2. Customizing Security Thresholds

If you want the build to fail on moderate or higher vulnerabilities, and only annotate high or critical issues:

image: node:20

pipelines:
  default:
    - step:
        name: Security Audit
        script:
          - corepack enable pnpm
          - export BPR_LEVEL=low # Fails the build if any moderate, high, or critical issues are found
          - export BPR_LOG=high # Only create inline annotations for high or critical severities
          - pnpm dlx bitbucket-audit-report

Limitations

  • Annotation Limit: Bitbucket Reports API enforces a maximum of 1000 annotations per report. Any vulnerabilities beyond the first 1000 will be omitted from the inline annotations, but will still count towards the main report status.

Contributing

Please see CONTRIBUTING.md for details on filing pull requests and commit guidelines.

License

This project is licensed under the terms of the Very Open License (VOL).