Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 581 Bytes

README.md

File metadata and controls

26 lines (20 loc) · 581 Bytes

etcd-watcher, watch etcd key creation and subsequent changes

Install

You need node-etcd.

$ npm install node-etcd
$ npm install etcd-watcher

Usage

var Etcd = require('node-etcd');
var etcd = new Etcd();
var etcdWatcher = require('etcd-watcher');

var watcher = etcdWatcher.watcher(etcd, ['key1', 'key2']);
watcher.wait(function (err, values) {
    console.log('keys set', values);
    watcher.on('change', function (values) {
        console.log('key change', values);
    })
});