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

nsp-preprocessor-yarn

v1.1.2

Published

Usage:

Downloads

738

Readme

Yarn.lock preprocessor for NSP

Usage:

npm install -g nsp nsp-preprocessor-yarn
nsp check --preprocessor yarn

Or, automating the nsp check upon testing:

{
  "name": "dummy",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "posttest": "nsp check --preprocessor yarn"
  },
  "dependencies": {
    "nsp": "git://github.com/nodesecurity/nsp.git#41f967f",
    "nsp-preprocessor-yarn": "nsp-preprocessor-yarn"
  }
}

If it logs Preprocessing the lock file 'yarn.lock'. this means you're covered.

Why

TLDR: if you use Yarn and NSP you need a preprocessor like nsp-preprocessor-yarn, to ensure all your dependencies are checked.

NSP works by uploading (parts of) your package.json and npm-shrinkwrap/package-lock to it's vulnerabillity-checking servers. If you don't have a npm-shrinkwrap/package-lock (hello there, Yarn users!) this means NSP only uploads a package.json. Therefore NSP reconstructs your dependency tree on their servers, in the NPM fashion: undeterministically.

There will eventually be inconsistencies between what Yarn installed and what NSP thinks you have installed. As the yarn.lock precisely states what is installed, the nsp-preprocessor-yarn transforms that into a format NSP understands.

Silent

This preprocessor logs a short message, to indicate the processor has run, to let you know you're safe. If you're parsing the output of the nsp run, and this message is annoying, you can disable the message by setting --preprocess--silently.

Workspaces

This preprocessor supports Yarn workspaces too: specify the --lockfile flag:

touch workspace/yarn.lock
cd workspace/my-package-1
nsp check --preprocessor yarn --lockfile ../yarn.lock