keyv-file
File storage adapter for Keyv, using msgpack to serialize data fast and small.
File storage adapter for Keyv.
TTL functionality is handled internally by interval scan, don't need to panic about expired data take too much space.
Install
npm install --save keyv keyv-file
Usage
const Keyv = require('keyv')
const KeyvFile = require('keyv-file')
const keyv = new Keyv({
store: new KeyvFile()
});
const customKeyv = new Keyv({
store: newKeyvFile({
filename: `${os.tmpdir()}/keyv-file/default-rnd-${Math.random().toString(36).slice(2)}.msgpack`
expiredCheckDelay: 24 * 3600 * 1000,
writeDelay: 100,
})
})
License
MIT © Zaaack