https://github.com/roccomuso/keyv-etcd
Etcd Storage adapter for Keyv
https://github.com/roccomuso/keyv-etcd
adapter etcd js keyv keyvaluestore nodejs storage store
Last synced: about 2 months ago
JSON representation
Etcd Storage adapter for Keyv
- Host: GitHub
- URL: https://github.com/roccomuso/keyv-etcd
- Owner: roccomuso
- Created: 2018-03-23T13:14:06.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-11-30T16:54:36.000Z (over 3 years ago)
- Last Synced: 2025-02-10T14:52:36.439Z (4 months ago)
- Topics: adapter, etcd, js, keyv, keyvaluestore, nodejs, storage, store
- Language: JavaScript
- Size: 41 KB
- Stars: 4
- Watchers: 5
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @keyv/etcd [
](https://github.com/lukechilds/keyv)
> Etcd storage adapter for Keyv
[](https://travis-ci.org/roccomuso/keyv-etcd)
[](https://coveralls.io/github/roccomuso/keyv-etcd?branch=master)
[](https://www.npmjs.com/package/@keyv/etcd)[Etcd](/coreos/etcd) storage adapter for [Keyv](https://github.com/lukechilds/keyv).
TTL functionality is handled directly by Etcd so no timestamps are stored and expired keys are cleaned up internally.
## Install
```shell
npm install --save keyv @keyv/etcd
```## Usage
```js
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](https://github.com/stianeikeland/node-etcd#constructor-options).
e.g:
```js
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:
```js
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](https://twitter.com/roccomuso))