2.0.3 • Published 6 years ago

search-npm-registry v2.0.3

Weekly downloads
28
License
MIT
Repository
github
Last release
6 years ago

search-npm-registry

Quickly query NPM registry.

How to use?

const searchNpmRegistry = require('search-npm-registry');

(async () => {
  const results = await searchNpmRegistry()
    .text('react')
    .size(5)
    .search();

  // results = [{ name: 'react', description: '...', ... }, ...]
  console.log(results);
})();

API

Calling searchNpmRegisty will return an instance of SearchNpmRegistry. You then can chain all the required options before searching modules:

  • .text(string)
  • .size(integer), limit
  • .from(integer)
  • .quality(float), .popularity(float), .maintenance(float)

When you're all set, simply call .search(). You'll get a Promise object from it.
Need more information about search parameters?

License

MIT @ eveningkid