A small wrapper around the npms.io api.
npm install npms-api
const { search, info } = require("npms-api");
(async () => {
await search("cross-spawn");
//=> { total: 45, results: [ { package: "cross-spawn", scope: "unscoped" ... } ... ] }
await info("cross-spawn");
//=> { analyzedAt: '2020-02-23T05:44:56.198Z', collected: { metadata: { name: "cross-spawn", scope: "unscoped" ... } ... } ... }
})();
Type: string
The query to search with.
Type: object
Type: boolean
Default: false
Return search suggestions.
Type: number
Default: 0
The offset of the results. Not compatible with suggestions
.
Type: number
Default: 25
The amount of results to return.
Type: string|string[]
The name/names of the packages.