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

yarn-justify

v1.0.0

Published

> A CLI tool for checking and reporting justification of inclusion of NodeJS packages based on Yarn lock file

Downloads

4

Readme

Yarn Justify

A CLI tool for checking and reporting justification of inclusion of NodeJS packages based on Yarn lock file

A script (recommended to run as a pre-commit hook) which updates a package-justifications.md file with a list of justifications for including the package to always include all packages used at any one time.

Justifications are synchronized with the package list and need to be explicitly approved otherwise the script fails with an error in case there is an unjustified dependency (top-level or any depending on --top-level-only).

Features:

  • Generating a package-justifications.md file with justification and approval for dependencies
  • Switching between requiring justifications for all or only top-level packages (--top-level-only)
  • (In development) Automatic installation of the pre-commit Git hook after installation
  • (In development) Displaying commiters who approved packages without justifying using git blame

Installing

(In development)

yarn add yarn-justify

We recommend you accompany Yarn Justify with auditjs in order to be able to make a more informed decision when justifying inclusion of NPM packages.

Support:

At this time only Yarn is supported and lock file version 1 (latest) is required. NPM support is (in development and coming soon).

Running

As a user:

The script installs itself as a Git pre-commit hook and abort commit with unjustified, approved dependencies.

Optionally you can add a justify script package.json:

{
  // …
  "scripts": {
    // …
    "justify": "yarn-justify",
    // …
  },
  // …

You can run this script using yarn justify or update the pre-commit hook to run it.

See Using for more information about CLI usage.

As a contributor:

yarn start

See Contributing for more information.

Using

NPM lock file support is coming

yarn-justify

Synchronizes dependencies from the yarn.lock, reports all approved-but-unjustified dependencies, updates package-justification.md if none.

yarn-justify --top-level-only

Synchronizes dependencies from the yarn.lock, reports all approved-but-unjustified dependencies (only those mentioned in dependencies and devDependencies in package.json, not indirect ones), updates package-justification.md if none.

yarn-justify $package "$reason"

Updates the Justification cell in package-justification.md and [x] approves the package. The same can be done manually if so desired.

Contributing

This script itself doesn't use any dependencies for its function, so running the tool on itself will produce an empty result.

Feel free to temporarily add packages during development, but do not commit package.json with packages with packages unless they are actualliy utilized for the contribution's function.

The same goes for package-justification.md where only actually utilized packages should be commited, too.

See development plan.

Studying

See development log.