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

0.4.0 • Public • Published

npms-lib

NPM Codecov branch CircleCI CircleCI

Typed API client for npms

Contents

Installation

# NPM
npm install npms-lib

# Yarn
yarn add npms-lib

Example

import * as npms from 'npms-lib';

const result = await npms.search({ query: 'typescript', size: 1 });
console.log(result.results[0].package.name); // typescript

API Reference

  • search: Returns specified number of packages that match the specified parameters.

  • suggestions: Like search but with pre-set search parameters.

  • info: Returns information from one or more specified packages.

Use with Node.js

The library assumes it's running on a browser, so it relays on the fetch API. node-fetch is a good option:

import fetch from 'node-fetch';
import * as npms from 'npms-lib';

npms.config.fetch = fetch;

License

All the files in the repository are subject to the MIT license. Please refer to the License file at the root of the project to know more about it.

Package Sidebar

Install

npm i npms-lib

Weekly Downloads

2

Version

0.4.0

License

MIT

Unpacked Size

47.2 kB

Total Files

11

Last publish

Collaborators

  • frantss