# @types/node-fetch-cache

> TypeScript definitions for node-fetch-cache

Latest version **3.0.5** (published 2024-01-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/node-fetch-cache
pnpm add @types/node-fetch-cache
yarn add @types/node-fetch-cache
bun add @types/node-fetch-cache
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.0.5 |
| Published | 2024-01-16 |
| First published | 2023-01-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51419 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/node-fetch-cache
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-fetch-cache
- npm.io page: https://npm.io/package/@types/node-fetch-cache

## Dependencies (1)

- [@types/node-fetch](https://npm.io/package/@types/node-fetch.md) *

## Recent versions

- 3.0.5 (latest) — 2024-01-16
- 3.0.4 (ts4.5) — 2023-11-07
- 3.0.0 (ts4.2) — 2023-01-08
- 3.0.3 — 2023-10-18
- 3.0.2 — 2023-10-16
- 3.0.1 — 2023-09-23

## README

# Installation
> `npm install --save @types/node-fetch-cache`

# Summary
This package contains type definitions for node-fetch-cache (https://github.com/mistval/node-fetch-cache#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-fetch-cache.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-fetch-cache/index.d.ts)
````ts
import fetch = require("node-fetch");

declare class NFCResponse extends fetch.Response {
    ejectFromCache(): Promise<void>;
}

interface Cache {
    get(key: string): Promise<any>;
    remove(key: string): Promise<void>;
    set(key: string, bodyStream: fetch.Response["body"], metaData: any): Promise<any>;
}

interface MemoryCacheOptions {
    ttl?: number;
}

export class MemoryCache implements Cache {
    constructor(options?: MemoryCacheOptions);
    get(key: string): Promise<any>;
    remove(key: string): Promise<void>;
    set(key: string, bodyStream: fetch.Response["body"], metaData: any): Promise<any>;
}

interface FileSystemCacheOptions {
    ttl?: number;
    cacheDirectory?: string;
}

export class FileSystemCache implements Cache {
    constructor(options?: FileSystemCacheOptions);
    get(key: string): Promise<any>;
    remove(key: string): Promise<void>;
    set(key: string, bodyStream: fetch.Response["body"], metaData: any): Promise<any>;
}

type FetchBuilder = (cache: Cache) => FetchCache;
type FetchCache = ((...args: Parameters<typeof fetch>) => Promise<NFCResponse>) & {
    withCache: FetchBuilder;
};

declare const defaultFetch: FetchCache;
export default defaultFetch;

export const fetchBuilder: FetchCache;

````

### Additional Details
 * Last updated: Tue, 16 Jan 2024 23:07:00 GMT
 * Dependencies: [@types/node-fetch](https://npmjs.com/package/@types/node-fetch)

# Credits
These definitions were written by [Yusuke Fujiki](https://github.com/fujikky).

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