nk

npm-keyword

Get a list of npm packages with a certain keyword

Showing:

Popularity

Downloads/wk

80.6K

GitHub Stars

42

Maintenance

Last Commit

10mos ago

Contributors

7

Package

Dependencies

2

Size (min+gzip)

17.6KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

npm-keyword Build Status

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.

  • 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

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial