undici-cache-store-better-sqlite3
v0.1.1
Published
A undici cache store powered by `better-sqlite3` instead of `node:sqlite`
Downloads
186
Maintainers
Readme
undici-cache-store-better-sqlite3
A undici cache store powered by better-sqlite3
instead of node:sqlite
.
Installation
# npm
npm install undici-cache-store-better-sqlite3
# yarn
yarn add undici-cache-store-better-sqlite3
# pnpm
pnpm add undici-cache-store-better-sqlite3
Usage
import { BetterSqlite3CacheStore } from 'undici-cache-store-better-sqlite3';
import undici, {
interceptors,
Agent,
setGlobalDispatcher
} from 'undici';
const agent = new Agent({});
setGlobalDispatcher(agent.compose(
interceptors.cache({
store: new BetterSqlite3CacheStore({
/**
* Location of the database
* @default ':memory:'
*/
location: ':memory:';
/**
* @default Infinity
*/
maxCount: Infinity;
/**
* @default Infinity
*/
maxEntrySize: Infinity;
})
})
));
License
undici-cache-store-better-sqlite3 © Sukka, Released under the MIT License. Authored and maintained by Sukka with help from contributors (list).
Personal Website · Blog · GitHub @SukkaW · Telegram Channel @SukkaChannel · Mastodon @[email protected] · Twitter @isukkaw · Keybase @sukka