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 🙏

© 2024 – Pkg Stats / Ryan Hefner

bpr-npm-audit

v1.4.4

Published

Bitbucket Pipelines report for "npm audit".

Downloads

1,654

Readme

bpr-npm-audit

Bitbucket Pipelines added reports as a feature in pull requests.

With this module, you can get the results of npm audit as a report, with zero configuration, using npx:

pipelines:
  my-pipeline:
    - step:
        script:
          - npx bpr-npm-audit

Have a look at this example pull request, which generates a report like this:

Example report image

Security

This module has zero dependencies (outside of NodeJS), and is simple enough to audit yourself.

If you are very paranoid, I recommend forking this repository, auditing the forked code, and then using npx pointed to your fork:

pipelines:
  my-pipeline:
    - step:
        script:
          - npx username/bpr-npm-audit

(Where username is your Github username.)

Configure

Parameters are passed in as environment variables. For example:

pipelines:
  my-pipeline:
    - step:
        script:
          - BPR_NAME="My Report" BPR_ID="myid" BPR_LEVEL="low" BPR_MAX_BUFFER_SIZE="20971520" npx bpr-npm-audit

proxy

Configure by setting the environment variable BPR_PROXY to one of these options.

  • local - (default) Used in normal Pipelines.
  • pipe - Used in custom pipes.

Report Name

Configure by setting the environment variable BPR_NAME.

Default: Security: npm audit

Report ID

Configure by setting the environment variable BPR_ID.

Default: npmaudit

Fail Condition

Configure by setting the environment variable BPR_LEVEL to one of these options:

  • low
  • moderate
  • high (the default)
  • critical

If there are any vulnerabilities at that level or higher, the report will be marked as failed.

Reporting Level

Configure by setting the environment BPR_LOG to any of the BPR_LEVEL values.

If this is not set, all audit log entries will be included in the Pipeline Report.

Setting this property will limit the Report to contain only audit log entries at this level or higher.

Max Buffer Size

Configure by setting the environment variable BPR_MAX_BUFFER_SIZE to desired value in bytes.

Default: 10485760 (10 MB)

The value shouldn't be changed unless you run into problems with npm audit output being too large to handle (usually signalled by Unexpected end of JSON input error).

License

This project is published and released under the Very Open License.


(Made with ❤️ by Tobias Davis.)