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

npm-global-audit

v1.2.0

Published

CLI to perform an audit of globally installed node modules

Downloads

95

Readme

NPM Global Audit

A utility to simplify (and make possible) an audit, i.e. npm audit, of globally installed node modules.

Version Downloads/week License

Usage

npx npm-global-audit

# or, if you prefer to use npm instead of yarn to perform the actual audit

npx npm-global-audit --auditor npm

How it works

npm-global-audit will determine your globally installed node modules using npm built in tools (npm ls -g --depth=0) and will then construct a minimal package.json file in your system temp directories, then use this "local" package.json as the package definition against which an audit can be performed. The audit will be performed against a package.json composed of the exact versions of node modules installed globally at the time of execution, i.e. it does not calculate any semver ranges.

Notes

  • By default the actual audit is performed by yarn (which will be executed via npx in the event that you do not have yarn installed) as the output is more human-readable. You can use npm instead if you prefer by passing the -a / --auditor option.
  • Your node modules need to be installed locally so that a lockfile can be generated which is needed to perform the audit (this is not strictly true when the auditor is yarn, but to keep the logic of this utility simple, it performs the install anyway). To ensure that your system temp dirs won't bloat up with ephemeral node_module installs the script will remove the installed "local" packages when the audit is complete, but will not remove the generated package.json or any relevant lockfiles.
  • The audit only supports npm globally installed node modules. This may be expanded to include other package managers in the future.