qnm icon indicating copy to clipboard operation
qnm copied to clipboard

:mag: cli utility for querying the node_modules directory


:mag: A simple cli utility for querying the node_modules directory

Build Status NPM version License



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

When debugging a problem, I sometimes find myself checking what are the installed versions of the modules within node_modules directory. Current solutions like running npm list are not fast enough and prints too much clutter, checking the version in the package.json takes a bit more effort and doesn't give you more information regarding other occurrences of this module.

qnm aims to get this information fast and tries to filter only the important parts, while supporting both yarn & npm.


  • :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


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

npm i --global qnm


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.



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



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.


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




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



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


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

└── 3.3.0

└── 2.6.1

└── 4.12.1

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


Opens package "homepage" property in your browser.


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


The MIT License