https://github.com/eveningkid/search-npm-registry
Search packages/modules among the NPM registry
https://github.com/eveningkid/search-npm-registry
Last synced: 3 months ago
JSON representation
Search packages/modules among the NPM registry
- Host: GitHub
- URL: https://github.com/eveningkid/search-npm-registry
- Owner: eveningkid
- License: mit
- Created: 2018-03-01T08:54:18.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-01T11:17:54.000Z (over 7 years ago)
- Last Synced: 2025-03-06T12:18:56.167Z (3 months ago)
- Language: JavaScript
- Size: 10.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# search-npm-registry
Quickly query NPM registry.## How to use?
```js
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?](https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md#get-v1search)## License
MIT @ eveningkid