Skip to content

Commit

Permalink
release: 5.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
huijiewei committed Jul 4, 2024
1 parent 751092b commit 0e4ea12
Show file tree
Hide file tree
Showing 4 changed files with 353 additions and 760 deletions.
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,22 @@ npm i @resolid/cache-manager-sqlite
## Usage

```js
import {sqliteStore} from '@resolid/cache-manager-sqlite';
import {createCache} from 'cache-manager';
import {join} from 'node:path';
import { sqliteStore } from '@resolid/cache-manager-sqlite';
import cacheManager,{ createCache } from "cache-manager";
import { join } from 'node:path';

// SQLite :memory: cache store
const memStoreCache = cacheManager.caching(sqliteStore({cacheTableName: 'caches'}));
const memStoreCache = await cacheManager.caching(sqliteStore({cacheTableName: 'caches'}));

// On disk cache on caches table
const sqliteStoreCache = cacheManager.caching(sqliteStore({sqliteFile: join(process.cwd(), 'cache.sqlite3'), cacheTableName: 'caches'}))
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
Expand Down
Loading

0 comments on commit 0e4ea12

Please sign in to comment.