Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Frantss/npms-lib

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published