0.1.9 • Published 3 years ago

npm-package-types-fetch v0.1.9

Weekly downloads
22
License
ISC
Repository
github
Last release
3 years ago

About

Use this package to get npm package type files, get npm package versions from an API.

Specify package name and version, or just package name to get the latest package ver. types; It checks for a package type definition files in a package itself, and if not found checks in @types/{packageName}@{packageVer}. If there is no types available for current ver., types from a last previous version returned;

Usage

const types = await getPackageTypes('react', '16.14.0'); console.log('package types', types);

// Get latest npm package version type definition files const types = await getPackageTypes('react'); console.log('package types', types); //

Example

// import * as fs from 'fs'; // import { getPackageTypes } from 'npm-package-types-fetch/build/src';

(async () => { const types = await getPackageTypes('react', '16.14.0'); console.log('package types', types);

// Example output... { 'dist/communication.d.ts': 'import { EventDispatcher } from "./dispatcher";... 'dist/dispatcher.d.ts': 'export declare abstract class EventDispatcher {\r\n'";... }

0.1.8

3 years ago

0.1.9

3 years ago

0.1.7

3 years ago

0.1.6

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.0

4 years ago

0.1.1

4 years ago

0.0.10

4 years ago

0.0.11

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.6

4 years ago

0.0.1

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.0

4 years ago