Skip to content

roccomuso/keyv-etcd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@keyv/etcd keyv

Etcd storage adapter for Keyv

Build Status Coverage Status npm

Etcd storage adapter for Keyv.

TTL functionality is handled directly by Etcd so no timestamps are stored and expired keys are cleaned up internally.

Install

npm install --save keyv @keyv/etcd

Usage

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 });

License

MIT © Rocco Musolino (@roccomuso)