Git Product home page Git Product logo

improved-yarn-audit's Introduction

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 253,456,811

.iyarc File

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

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,53,124

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

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.

improved-yarn-audit's People

Contributors

djfdyuruiry avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.