Skip to content

sindresorhus/npm-keyword

main
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

npm-keyword

Get a list of npm packages with keywords

Install

npm install npm-keyword

Usage

import npmKeyword from 'npm-keyword';

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

Caveat

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

API

npmKeyword(keywords, options?)

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

keywords

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(keywords, options?)

Returns a promise for a list of package names.

keywords

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(keywords)

Returns a promise for the count of packages.

keywords

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