🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

etcd-watcher

Package Overview
Dependencies
Maintainers
4
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

etcd-watcher

Wait for etcd key creation and watch changes

1.0.2
latest
Source
npm
Version published
Weekly downloads
399
-42.17%
Maintainers
4
Weekly downloads
 
Created
Source

etcd-watcher, watch etcd key creation and subsequent changes

Install

You need node-etcd.

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

Usage

Please note that returned values object will be modified by this library, if you want to compare values between change events, you'll need to clone the returned values.

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

var watcher = etcdWatcher.watcher(etcd, {
    key1: {
        required: true,
        etcd: '/foo/bar/key1' 
    },
    key2: {
        required: false,
        default: 'defaultValue'
    },
    key3: { // will fetch all subNodes and return them as objet, also react to any child modification
        etcd: '/foo',
    }
});
watcher.wait(function (err, values) {
    console.log('keys set', values);
    watcher.on('change', function (values) {
        console.log('key change', values);
    })
});

FAQs

Package last updated on 21 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts