1.0.2 • Published 5 years ago

npm-description v1.0.2

Weekly downloads
9
License
MIT
Repository
github
Last release
5 years ago

Fetch a package's description from NPM.

Uses cross-fetch-json to support usage in both brower and node.

Installation

yarn add npm-description
npm install npm-description

API

Usage

import { getDescription, getDescriptions } from "npm-description";

getDescription("chalk").then((result) => {
  console.log(result); // "Terminal string styling done right"
});

getDescriptions(["chalk", "commander"]).then((result) => {
  console.log(result.chalk); // "Terminal string styling done right"
  console.log(result.commander); // "the complete solution for node.js command-line programs"
});

Types

import { getDescription, getDescriptions, Descriptions } from "npm-description";

function getDescription(name: string): Promise<string | undefined>;

function getDescriptions(names: string[]): Promise<Descriptions>;

export type Descriptions = {
  [name: string]: string | undefined;
};

MIT

Related Packages: