# @budarin/cache-store

> Service for storing json data in the browser cache

Latest version **1.1.0** (published 2025-10-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @budarin/cache-store
pnpm add @budarin/cache-store
yarn add @budarin/cache-store
bun add @budarin/cache-store
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2025-10-15 |
| First published | 2023-11-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Vadim Budarin |
| Maintainers | budarin |
| Keywords | Cache store |

## Links

- npm: https://www.npmjs.com/package/@budarin/cache-store
- Repository: https://github.com/budarin/cache-store
- Homepage: https://github.com/budarin/cache-store#readme
- Issues: https://github.com/budarin/cache-store/issues
- npm.io page: https://npm.io/package/@budarin/cache-store

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2025-10-15
- 1.0.20 — 2025-05-09
- 1.0.19 — 2025-03-17
- 1.0.18 — 2024-03-22
- 1.0.17 — 2024-03-07
- 1.0.16 — 2024-03-05
- 1.0.15 — 2024-02-17
- 1.0.14 — 2023-11-29
- 1.0.13 — 2023-11-29
- 1.0.12 — 2023-11-29
- 1.0.11 — 2023-11-29
- 1.0.10 — 2023-11-29
- 1.0.9 — 2023-11-29
- 1.0.8 — 2023-11-29
- 1.0.7 — 2023-11-28
- … 7 more at https://npm.io/package/@budarin/cache-store/versions

## README

# cache-store

Service for storing json data in the browser cache.

The service is a simple alternative to IndexedDB, but without an overhead for the description of the structure and the ceremonies for updating and changing structure.

This storage is convenient both for direct storage of unstructured data in the form of JSON and as a common data storage shared by the client and the service worker.

## Instalation

```bash
yarn add @budarin/cache-store
```

## Usage

```ts
import { CacheStore } from '@budarin/cache-store';

const store = new CacheStore('kv-storage');
const usersStore = [
    {
        name: 'Ivan',
        age: 20,
    },
    {
        name: 'Petr',
        age: 21,
    },
];

await store.setItem('users', usersStore);

const users = await store.getItem('users');
users.forEach((user) => console.log(user));

await store.removeItem('users');
await store.clear('kv-storage');
```

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