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

qnm

v2.10.3

Published

cli utility for querying the node_modules directory

Downloads

3,090

Readme

Why?

most bugs are caused by the assumptions we didn't realize we were making.

I often need to quickly check the versions of the modules installed in the node_modules directory. Current solutions like running npm list are slow and produce a lot of irrelevant output. Checking the version in the package.json file of the specific module requires more effort and doesn’t provide information about other instances of the same module.

qnm is a tool that solves this problem by providing fast and focused information about the installed modules. It supports both npm and yarn and allows you to quickly identify the versions of the modules you are interested in.

Features

  • :sparkles: Interactive fuzzy-search
  • :abc: Match all packages with a specific string
  • :interrobang: Explain why a package was installed
  • :books: Supports monorepos
  • :clock12: Show when a version was release and what is the latest version

Installation

If you don't want to install qnm, you can also prepend the command with npx

npm i --global qnm

Usage

qnm [module]

For example, if you want to see the installed versions of lodash:

qnm lodash

And you'll see something like that:

lodash 4.17.21 ↰ 2 days ago
├── 4.17.21 ✓
├─┬ cli-table2
│ └── 3.10.1 ⇡ 1 year ago
└─┬ karma
  └── 3.10.1 ⇡ 1 year ago

Which means you have 3 occurrences of lodash in your node_modules:

  1. ./node_module/lodash
  2. ./node_module/cli-table2/node_modules/lodash
  3. ./node_module/karma/node_modules/lodash
  • The latest version of lodash is 4.17.21, it was published 2 days ago.
  • The other 2 occurrences of lodash (3.10.1) were released a year ago.

Fuzzy-search

Use qnm command without arguments to trigger an fzf like fuzzy search.

  • Start typing to filter the matches from your node_modules
  • Use arrows to move cursor up and down
  • Enter key to select the item, CTRL-C / ESC to exit
  • TAB and Shift-TAB to mark multiple items

Options

--no-remote

do not fetch remote data from npm, use this if you want qnm to run faster. qnm will show limited view.

-o , --open

Open the module's package.json file with the default editor.

-d, --debug

See full error messages, mostly for debugging.

--disable-colors

Disables the most of colors and styling. E.g. version colors.

Commands

doctor

experimental

Shows the heaviest modules in your node_modules. Helpful if you want to understand what's taking the most space on your node_modules directory.

qnm doctor

sort the modules based on the amount of duplications they have in your node_modules.

qnm doctor --sort duplicates

image

list

alias: ls

Returns a list of all modules in node_modules directory.

qnm list

| Optional arguments | Description | | ------------------ | :-------------------------------------------------------------------------------------: | | --deps | List the versions of direct dependencies and devDependencies. | | --remote | Fetch remote data, this may be very slow for many packages due to many network requests |

match

Works like grep, and match's any module that includes the supplied string.

For example, i want to see which eslint plugins i have installed:

> qnm match eslint-plug

eslint-plugin-babel
└── 3.3.0

eslint-plugin-lodash
└── 2.6.1

eslint-plugin-mocha
└── 4.12.1

eslint-plugin-react
└── 6.10.3

| Optional arguments | Description | | ------------------ | :-------------------------------------------------------------------------------------: | | --remote | Fetch remote data, this may be very slow for many packages due to many network requests |

homepage

Opens package "homepage" property in your browser.

Contributing

Help is always welcome! Please head to the CONTRIBUTING.md file to see how to get started.

License

The MIT License