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 🙏

© 2025 – Pkg Stats / Ryan Hefner

bomlint

v2.1.0

Published

Align dependencies across projects.

Downloads

52

Readme

build

bomlint

Features

  • centralizes dependency versions in a single BOM file
  • ensures versions are aligned across multiple npm packages (mono-repo, or not)
  • provides tooling to manage your BOM and keep your dependencies aligned

Getting started

install :

npm i -D bomlint

Usage in package.json:

"scripts" {
    "bomlint": "bomlint check",
    "bomlint:fix": "bomlint fix"
},

This will check the project's package.json against the BOM. It scan dependencies and check their versions against the ones defined in the BOM file. The build will fail if a dependency has a version not defined in the BOM :

// .bomlint.json
{
    "react": "^16.0.0"
}

// package.json : BAD REACT VERSION !!
{
    "dependencies": {
        "react": "^17.0.0"
    }
}

Several package.json files can be checked at the sime time, which can be useful in mono-repos :

// in root package.json
"scripts" {
    "bomlint": "bomlint check package.json ./core/package.json ./sample/package.json",
},

bomlint also checks for "conflicting" dependencies in your package.json files. It looks for dependencies declared more than once, with different versions :

// app1/package.json
{
    "dependencies": {
        "react": "^16.0.0"
    }
}

// app2/package.json : DIFFERENT REACT VERSION
{
    "dependencies": {
        "react": "^17.0.0"
    }
}

This helps to spot what should be added to the BOM file.

If the conflict is required (ie you need different versions of a lib in some of your packages), then you can use --allow-conflicts to "skip" the conflict test on some dependencies.

Configuration

The tool looks for a .bomlint.json file in the current folder, and will look into parents like it's done for .gitignore, .npmrc and the like. A path to the config file can be passed if needed (--bom <bomfile> command line option).

You can share your bom file as a Node module between different repositories, --bom <module> will solve the file bomlint.json from <module>, which you added to your devDependencies.

The config is a JSON object with string properties, like a package.json's dependencies section :

{
    "mypkg": "^1.0.0",
    "typescript": "^4.0.2",
}

Those are the versions of the packages you want to align.

fix

bomlint can fix the BOM errors for you, by using the fix command. It will then change the versions in your package.json files according to the one set in the BOM file, if any.

This option only touches your package.json files.

merge

Merge will change the BOM file and add versions found in the package.json files. It's the inverse of fix.

This changes your dependency versions in the BOM file : handle with care !

purge

The purge command will remove versions from the BOM file that are no longer used by any of the package.json files.

Draft your initial .bomlint.json file

Try this script:

git ls-files --cached \
    | grep package.json \
    | xargs -L1 jq '[.dependencies, .peerDependencies, .devDependencies | .? | to_entries] | flatten | unique | from_entries' \
    | jq -s '[.[] | to_entries] | flatten | sort_by(.key) | reduce .[] as $dot ({}; .[$dot.key] += "|"+$dot.value)'

Do not forget to edit the versions!

A use scenario in a workspace

  • create your initial .bomlint.json file with dependencies you want to align across modules

  • enable bomlint for your first package (see above)

  • run bomlint check to check alignment

  • if versions differ, use bomlint merge and edit .bomlint.json to keep only the versions you want

  • run bomlint fix to apply versions to this package

  • repeat for other modules in your workspace

You can handle several package.json files at a time passing them to bomlint commands. At the root folder of your workspace, for example use

  • bomlint check $(git ls-files --cached | grep package.json)
  • bomlint fix $(git ls-files --cached | grep package.json)
  • bomlint merge $(git ls-files --cached | grep package.json)
  • bomlint purge $(git ls-files --cached | grep package.json)