$ cnpm install npm-keyword
Get a list of npm packages with a certain keyword
$ npm install npm-keyword
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
})();
The list of packages will contain a maximum of 250 packages matching the keyword. This limitation is caused by the npm registry API.
Returns a promise for a list of packages having the specified keyword in their package.json keyword property.
Type: string string[]
Example: ['string', 'camelcase']
One or more keywords. Only matches packages that have all the given keywords.
Type: Object
Type: number
Default: 250
Limits the amount of results.
Returns a promise for a list of package names. Use this if you don't need the description as it's faster.
Type: string string[]
Example: ['string', 'camelcase']
One or more keywords. Only matches packages that have all the given keywords.
Type: Object
Type: number
Default: 250
Limits the amount of results.
Returns a promise for the count of packages.
Type: string string[]
Example: ['string', 'camelcase']
One or more keywords. Only matches packages that have all the given keywords.
MIT © Sindre Sorhus
Copyright 2013 - present © cnpmjs.org | Home |