Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find NPM packages by keywords and authors

Tags:

npm

Considering I want to find all packages by several criteria and list them, e.g. find by polyfill keyword and filter by specific user.

How can this be done?

The reason I'm asking on SO is that I suspect that this feature is not officially supported by NPM CLI tool and website and may require the use of NPM API.

like image 660
Estus Flask Avatar asked Oct 17 '18 11:10

Estus Flask


2 Answers

To search by author and keyword, you can use the following query in the npmjs.com search bar:

author:sindresorhus keywords:polyfill

According to the npm docs on Searching for and choosing packages to download:

npm search uses npms and the npms analyzer in the website searchbar

According to the NPMS (NPM Search) docs on how to perform a search query, you can use the following operators:

Search Syntax Description
scope:types Show/filter results that belong to the @types scope
author:sindresorhus Show/filter results in which sindresorhus is the author
maintainer:sindresorhus Show/filter results in which sindresorhus is qualifier as a maintainer
keywords:gulpplugin Show/filter results that have gulpplugin in the keywords (separate multiple keywords with commas, you may also exclude keywords e.g. -framework)
not:deprecated Exclude deprecated packages from the results
not:unstable Exclude packages whose version is < 1.0.0
not:insecure Exclude packages that are insecure or have vulnerable dependencies (as per nsp)
is:deprecated Show/filter is deprecated packages
is:unstable Show/filter packages whose version is < 1.0.0
is:insecure Show/filter packages that are insecure or have vulnerable dependencies (as per nsp)
boost-exact:false Do not boost exact matches, defaults to true
score-effect:14 Set the effect that package scores have for the final search score, defaults to 15.3
quality-weight:1 Set the weight that quality has for the each package score, defaults to 1.95
popularity-weight:1 Set the weight that popularity has for the each package score, defaults to 3.3
maintenance-weight:1 Set the weight that the quality has for the each package score, defaults to 2.05

See Also: How to find search/find npm packages

like image 163
KyleMit Avatar answered Oct 21 '22 17:10

KyleMit


It's not necessarily fully featured, but there is an npm search command-line argument. It allows searching by username with a search term starting with =, e.g. npm search express =dougwilson.

More granular searching doesn't seem supported. Open an issue?

EDIT: Also, this answer has a list of resources as well.

like image 24
R Y Avatar answered Oct 21 '22 18:10

R Y