npm-keyword
Get a list of npm packages with a certain keyword
Last updated 7 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install npm-keyword 
SYNC missed versions from official npm registry.

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.

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

Current Tags

  • 6.1.0                                ...           latest (7 years ago)

14 Versions

  • 6.1.0                                ...           7 years ago
  • 6.0.0                                ...           7 years ago
  • 5.0.0                                ...           8 years ago
  • 4.2.0                                ...           10 years ago
  • 4.1.0                                ...           10 years ago
  • 4.0.0                                ...           10 years ago
  • 3.0.1                                ...           11 years ago
  • 3.0.0                                ...           11 years ago
  • 2.0.0                                ...           11 years ago
  • 1.2.0                                ...           11 years ago
  • 1.1.1                                ...           11 years ago
  • 1.1.0                                ...           11 years ago
  • 1.0.1                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 1
Last Day 1
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (3)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |