npm-keyword
    Overview
    Documentation
    Insights
    Code
    Contributors
    Dependencies
    Alternatives

npm-keyword

Get a list of npm packages with a certain keyword

6.1.0  •  Updated 10 months ago  •  by Sindre Sorhus  •  MIT License

Get a list of npm packages with a certain keyword

Install

$ npm install npm-keyword

Usage

const npmKeyword = require('npm-keyword');

(async () => {
	console.log(await npmKeyword('gulpplugin'));
	//=> [{name: 'gulp-autoprefixer', description: '…'}, …]

	console.log(await npmKeyword.names('gulpplugin'));
	//=> ['gulp-autoprefixer', …]

	console.log(await npmKeyword.count('gulpplugin'));
	//=> 3457
})();

Caveat

The list of packages will contain a maximum of 250 packages matching the keyword. This limitation is caused by the npm registry API.

API

npmKeyword(keyword, [options])

Returns a promise for a list of packages having the specified keyword in their package.json keyword property.

keyword

Type: string string[]
Example: ['string', 'camelcase']

One or more keywords. Only matches packages that have all the given keywords.

options

Type: Object

size

Type: number
Default: 250

Limits the amount of results.

npmKeyword.names(keyword, [options])

Returns a promise for a list of package names. Use this if you don’t need the description as it’s faster.

keyword

Type: string string[]
Example: ['string', 'camelcase']

One or more keywords. Only matches packages that have all the given keywords.

options

Type: Object

size

Type: number
Default: 250

Limits the amount of results.

npmKeyword.count(keyword)

Returns a promise for the count of packages.

keyword

Type: string string[]
Example: ['string', 'camelcase']

One or more keywords. Only matches packages that have all the given keywords.

Related

  • package-json - Get the package.json of a package from the npm registry
  • npm-user - Get user info of an npm user
  • npm-email - Get the email of an npm user

License

MIT © Sindre Sorhus

How often do you use dark themes on other websites?

Popularity

Weekly Downloads
67.2K
Stars
36

Maintenance

Development

Last ver 10 months ago
Created 5 years ago
Last commit 8 months ago
1 month between commits

Technology

Node version: 8.15.0
7.3K unpacked

Compliance

MIT License
OSI Approved
0 vulnerabilities

Contributors

7 contributors
Sindre Sorhus
Maintainer, 39 commits, 7 merges
Kevin Martensson
Maintainer, 3 commits, 1 PRs
Works at imagemin yeoman
Michael Kühnel
3 commits, 3 PRs
Works at micromata
Dimitri Benin
2 commits, 2 PRs
Eddie Monge
1 commits, 2 PRs
Tomek Wiszniewski
1 commits, 1 PRs
Works at kalohq

Tags

npm
keyword
package
packages
pkg
registry
find
search
Ready for the next level?
Join Openbase's founding team to help us build the ultimate open-source app store, work with the latest technologies, and enjoy great culture, impact and autonomy
Openbase helps developers choose among and use millions of open-source packages, so they can build amazing products faster.
© 2020 Devstore, Inc.