npms-api
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

NPMS Api Travis CI Build Status

A small wrapper around the npms.io api.

NPM Badge

Install

npm install npms-api

Usage

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" ... } ... } ... }
})();

API

npmsApi.search(query, options?)

query

Type: string

The query to search with.

options

Type: object

suggestions

Type: boolean
Default: false

Return search suggestions.

offset

Type: number
Default: 0

The offset of the results. Not compatible with suggestions.

results

Type: number
Default: 25

The amount of results to return.

npmsApi.info(name)

npmsApi.info(names)

name

Type: string|string[]

The name/names of the packages.

Package Sidebar

Install

npm i npms-api

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

8.8 kB

Total Files

5

Last publish

Collaborators

  • richienb