Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nxht/cache-manager-bun-sqlite

Node Cache Manager store for Bun SQLite
https://github.com/nxht/cache-manager-bun-sqlite

bun cache-manager sqlite

Last synced: 3 months ago
JSON representation

Node Cache Manager store for Bun SQLite

Awesome Lists containing this project

README

        

# Node Cache Manager store for Bun SQLite

[bun:sqlite](https://bun.sh/docs/api/sqlite) store for the [node-cache-manager](https://github.com/BryanDonovan/node-cache-manager)

## Installation

```sh
bun install cache-manager-bun-sqlite
```

## Usage Examples

```typescript
import { caching } from 'cache-manager';
import { BunSqliteStore } from 'cache-manager-bun-sqlite';

const cache = caching(
BunSqliteStore({
name: 'test',
path: ':memory:',
ttl: 10, // in ms,
purgeInterval: 5 * 60 * 1000, // in ms
}),
);

await cache.set('foo', 'bar');
console.log(await cache.get('foo')); // 'bar'
```