Forrest logo
back to the npm tool

npm-query:tldr:e987c

npm-query: Print dependencies which have no dependencies.
$ npm query ':empty'
try on your machine

The npm query ':empty' command is used to filter and list all the npm packages that do not have any JavaScript files in their main directory.

When you execute this command, npm will search for packages with an empty "main" field in their package.json file. The "main" field specifies the entry point for a package. If there are no JavaScript files listed as the main entry point, npm considers the package to be empty. By using ':empty' as a query, npm returns a list of packages that meet this criteria.

This command is particularly useful when you want to find packages that may not have any functionality or are no longer maintained.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the npm tool