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

improved-yarn-audit

v3.0.0

Published

A wrapper around yarn audit that fixes many issues

Downloads

177,355

Readme

improved-yarn-audit

This project aims to improve upon the existing Yarn package manager audit functionality.

GitHub Repo: https://github.com/djfdyuruiry/improved-yarn-audit

NPM


Currently yarn audit has several issues making it difficult to use in a CI pipeline:

  • No way to ignore advisories
  • Unable to filter out low severity issues
  • Ongoing network issues with NPM registry cause false positives

improved-yarn-audit provides a wrapper around the yarn audit command which addresses all of the above problems.

Installing

Run:

yarn add improved-yarn-audit

Running an Audit Check

To execute an audit check, run:

yarn run improved-yarn-audit

Setting the Severity Level

You can define a minimum severity level to report, any advisories below this level are ignored.

yarn run improved-yarn-audit --min-severity moderate

Run with --help to see all levels available

Excluding Advisories

Often dev dependencies can become outdated and the package maintainer no longer provides updates. This leads to audit advisories that will never affect your production code.

To remedy this, you can pass a csv list of advisory IDs to ignore.

yarn run improved-yarn-audit --exclude GHSA-f9cm-p3w6-xvr3,GHSA-cph5-m8f7-6c5x,GHSA-gpvr-g6gh-9mc2

.iyarc File

If an .iyarc file is present in the current working directory, it will be parsed and used to specify a list of advisory exclusions.

Advisory exclusions to be ignored can either be provided on their own line, or as a comma separated list.

Example .iyarc file:

# This file can contain comments, you could do something like:
# 34 is ignored because there is no fix available (last checked 20th March 2020)
34

# This one doesn't affect us
GHSA-3fw8-66wf-pr7m

# We can also ignore all these, as a comma separated list
46,53,124
GHSA-f9cm-p3w6-xvr3,GHSA-cph5-m8f7-6c5x,GHSA-gpvr-g6gh-9mc2

Note: if you pass in exclusions using the command line, these will override the .iyarc file

Maintaining Advisory Exclusions

Over time as you bump package versions, exclusions may become redundant as those advisories are no longer present in your dependencies.

If you want to fail the audit check when exclusions are missing from the Yarn audit output use the --fail-on-missing-exclusions flag.

yarn run improved-yarn-audit --fail-on-missing-exclusions

The exit code will be the total number of missing exclusions detected.

Ignore All Dev Advisories

If you want to ignore any advisories from dev dependencies, you can use the --ignore-dev-deps flag to do this.

yarn run improved-yarn-audit --ignore-dev-deps

Retrying Network Issues

As of April 2019 there are outstanding network issues with the NPM registry audit API, which cause frequent request failues. To work around this until a fix is implemented you can pass a flag to retry any failed requests.

yarn run improved-yarn-audit --retry-on-network-failure

NPM Users

If you are an NPM fan looking for a similar solution, checkout the better-npm-audit package.