npm-description
v1.0.2
Published
Fetch a package's description from NPM
Downloads
249
Maintainers
Readme
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;
};
- cross-fetch-json: Universal fetch API that only returns JSON
- @bconnorwhite/bob: Bob is a toolkit for TypeScript projects
- jest: Delightful JavaScript Testing.
Related Packages:
- all-package-names: Get all NPM package names.
- npms-io-client: A universal typed npms.io client
- is-name-taken: Check if an NPM package name is taken