roccomuso / keyv-etcd

Etcd Storage adapter for Keyv

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@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)

About

Etcd Storage adapter for Keyv


Languages

Language:JavaScript 100.0%