etcd v2 client for node.js

npm install etcdx
5 downloads in the last week
20 downloads in the last month


Build status

node client for etcd v2 that adheres to waitIndex for watching.


var etcdx = require('etcdx');
var client = new etcdx();'/mongo_servers', true, function(error, server){
    // server is 'hello' then 'hello2'

client.set('/mongo_servers/server1', 'hello');
client.set('/mongo_servers/server1', 'hello2');


$ npm install etcdx



set the following options for further requests to the etcd server:

  • protocol
  • host
  • port
  • version

watch(key, recursive, trigger)

run 'trigger' each time a value at or below 'key' changes

'recursive' controls how deep we are watching

this function looks at the global etcd waitIndex in case a value has changed in-between our watch requests

get(key, done)

return the value of 'key'

set(key, value, done)

set the value of 'key'

set_ttl(key, value, ttl, done)

set the value of 'key' for 'ttl' seconds

del(key, done)

remove 'key'

ls(key, recursive, done)

list the entries below 'key' - recursive follows nested directories

mkdir(key, done)

create a directory (with no value) at 'key'

rmdir(key, done)

remove all values below key



npm loves you