Detalhes do pacote

npm-description

bconnorwhite80MIT1.0.2

Fetch a package's description from NPM

npm, get, description, package

readme (leia-me)

npm-description

npm typescript GitHub stars Twitter Follow


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;
};


Dependenciesdependencies

#


Dev DependenciesDavid

#


License license

MIT


Related Packages: