stianeikeland / node-etcd

:satellite: Etcd client for nodejs
BSD 3-Clause "New" or "Revised" License
259 stars 85 forks source link

How to watch changes within a directory recursively. #60

Closed louiekwan closed 8 years ago

louiekwan commented 8 years ago

Try a few ways to set the options, only work if key is a property but not a directory.

Nothing get return, if I make changes under the directory under monitor

var dir = '/' var options = {wait: true,recursive: true}; var watcher = etcd.watcher(dir, options);

watcher .on('set', function (data) { console.log('data: ', data); }) .on('change', function (data) { console.log('data: ', data); }) .on('expire', function (data) { console.log('Value expired.'); console.log('data: ', data); }) .on('delete', function (data) { console.log('Value deleted.'); console.log('data: ', data); });

jiachaosun commented 6 years ago

@louiekwan Did you find anyway to do that? I'd like to watch changes with directory too.