Etcd storage adapter for Keyv
Etcd storage adapter for Keyv.
TTL functionality is handled directly by Etcd so no timestamps are stored and expired keys are cleaned up internally.
npm install --save keyv @keyv/etcd
const Keyv = require('keyv');
const keyv = new Keyv('etcd://127.0.0.1:2379');
keyv.on('error', handleConnectionError);
Any valid options will be passed directly to the underlying store.
e.g:
const keyv = new Keyv('etcd://127.0.0.1:2379', { timeout: 1000, ssl: true });
Or you can manually create a storage adapter instance and pass it to Keyv:
const Keyv = require('keyv');
const KeyvEtcd = require('@keyv/etcd');
const etcd = new KeyvEtcd('etcd://127.0.0.1:2379');
const keyv = new Keyv({ store: etcd });
MIT © Rocco Musolino (@roccomuso)