# npm-package-types-fetch

> fetch type definition files for npm package

Latest version **0.1.9** (published 2020-12-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install npm-package-types-fetch
pnpm add npm-package-types-fetch
yarn add npm-package-types-fetch
bun add npm-package-types-fetch
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.9 |
| Published | 2020-12-15 |
| First published | 2020-10-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 44.7 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | fortedeimarmi21 |
| Keywords | npm package, package types, npm package types |

## Links

- npm: https://www.npmjs.com/package/npm-package-types-fetch
- Repository: https://github.com/fortedeimarmi21/npm-package-types-fetch
- Homepage: https://github.com/fortedeimarmi21/npm-package-types-fetch#readme
- Issues: https://github.com/fortedeimarmi21/npm-package-types-fetch/issues
- npm.io page: https://npm.io/package/npm-package-types-fetch

## Dependencies (6)

- [zlib](https://npm.io/package/zlib.md) ^1.0.5
- [tslib](https://npm.io/package/tslib.md) ~2.0.1
- [decompress](https://npm.io/package/decompress.md) ^4.2.1
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.1
- [tar-stream](https://npm.io/package/tar-stream.md) ^2.1.4
- [decompress-targz](https://npm.io/package/decompress-targz.md) ^4.1.1

## Recent versions

- 0.1.9 (latest) — 2020-12-15
- 0.1.8 — 2020-12-15
- 0.1.7 — 2020-12-14
- 0.1.6 — 2020-10-23
- 0.1.4 — 2020-10-23
- 0.1.3 — 2020-10-23
- 0.1.2 — 2020-10-23
- 0.1.1 — 2020-10-23
- 0.1.0 — 2020-10-23
- 0.0.11 — 2020-10-22
- 0.0.10 — 2020-10-22
- 0.0.9 — 2020-10-22
- 0.0.8 — 2020-10-22
- 0.0.6 — 2020-10-22
- 0.0.5 — 2020-10-22
- … 5 more at https://npm.io/package/npm-package-types-fetch/versions

## README

## 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'";...
}

---
_Source: https://npm.io/package/npm-package-types-fetch · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
