Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/huijiewei/cache-manager-sqlite
SQLite store for node cache manager
https://github.com/huijiewei/cache-manager-sqlite
Last synced: 18 days ago
JSON representation
SQLite store for node cache manager
- Host: GitHub
- URL: https://github.com/huijiewei/cache-manager-sqlite
- Owner: huijiewei
- License: mit
- Created: 2024-02-01T13:02:19.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-07-04T12:41:23.000Z (6 months ago)
- Last Synced: 2024-12-01T22:36:56.169Z (22 days ago)
- Language: TypeScript
- Size: 117 KB
- Stars: 7
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SQLite store for cache manager
A new SQLite cache store for [cache-manager](https://github.com/BryanDonovan/node-cache-manager).
## Featuring:
- using [better-sqlite3](https://github.com/WiseLibs/better-sqlite3)
- 100% test coverage and production ready
- Optimized `mset`/`mget` support
- ESM only## Installation
```
npm i @resolid/cache-manager-sqlite
```## Requirements
- SQLite 3 with [better-sqlite3](https://github.com/WiseLibs/better-sqlite3)
- Node 18+## Usage
```js
import { sqliteStore } from '@resolid/cache-manager-sqlite';
import cacheManager,{ createCache } from "cache-manager";
import { join } from 'node:path';// SQLite :memory: cache store
const memStoreCache = await cacheManager.caching(sqliteStore({cacheTableName: 'caches'}));// On disk cache on caches table
const sqliteStoreCache = await cacheManager.caching(sqliteStore({sqliteFile: join(process.cwd(), 'cache.sqlite3'), cacheTableName: 'caches'}));// SQLite :memory: cache store sync version
const memStoreCache = createCache(sqliteStore({cacheTableName: 'caches'}));// On disk cache on caches table sync version
const sqliteStoreCache = createCache(sqliteStore({sqliteFile: join(process.cwd(), 'cache.sqlite3'), cacheTableName: 'caches'}))```
## License
[MIT](./LICENSE).
## Thanks
Thanks to JetBrains for the [OSS development license](https://jb.gg/OpenSourceSupport).
![JetBrain](.github/assets/jetbrain-logo.svg)