npm-description

1.0.2 • Public • Published

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:

Package Sidebar

Install

npm i npm-description

Weekly Downloads

16

Version

1.0.2

License

MIT

Unpacked Size

6.07 kB

Total Files

6

Last publish

Collaborators

  • bconnorwhite