# @types/nano-cache

> TypeScript definitions for nano-cache

Latest version **1.1.4** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2023-11-07 |
| First published | 2020-08-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51449 |
| Maintainers | types |

## Links

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

## Recent versions

- 1.1.4 (latest) — 2023-11-07
- 1.1.2 (ts3.8) — 2022-02-23
- 1.1.1 (ts3.6) — 2021-07-08
- 1.1.0 (ts3.1) — 2020-08-28
- 1.1.3 — 2023-10-18

## README

# Installation
> `npm install --save @types/nano-cache`

# Summary
This package contains type definitions for nano-cache (https://github.com/akhoury/nano-cache).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/nano-cache.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/nano-cache/index.d.ts)
````ts
interface SIZE {
    GB: number;
    MB: number;
    KB: number;
}

interface Defaults {
    ttl?: number | undefined;
    limit?: number | undefined;
    bytes: number;
    compress: boolean;
    minFreeMem: number;
    maxEvictBytes: number;
}

interface Info {
    key: string;
    hits: number;
    accessed: number;
    updated: number;
    expires: number;
    value: unknown;
    bytes: number;
    ttl: number;
    compressed: boolean;
    cost: number;
    limit: number;
}

interface Stats {
    count: number;
    age: number;
    hits: number;
    evictions: number;
    misses: number;
    bytes: number;
}

interface Options {
    ttl?: number | undefined;
    limit?: number | undefined;
    bytes?: number | undefined;
    compress?: boolean | undefined;
    minFreeMem?: number | undefined;
    maxEvictBytes?: number | undefined;
}

declare class NanoCache {
    constructor(options?: Options);
    get(key: unknown): unknown;
    set(key: unknown, value: unknown, options?: Options): void;
    del(key: unknown): unknown;
    clear(): void;
    clearExpired(): void;
    isTTLExpired(key: unknown): boolean;
    isLimitReached(key: unknown): boolean;
    info(key: unknown): Info;
    stats(): Stats;
    static SIZE: SIZE;
    static DEFAULTS: Defaults;
    static singleton: NanoCache;
}

export = NanoCache;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: none

# Credits
These definitions were written by [Ross Coundon](https://github.com/rcoundon).

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