mcavage/node-zkplus — pull request #19 by vvo (2012-10-08 14:03:17+00:00)
Title: Add client.uwatch and client.pathExists

`u` is for `unlimited`

client.uwatch will continuously watch for a /path wether it exists or
not, or has been deleted or not. It will just give you the data as soon
as it is available/has changed.

client.uwatch('/my/path', function(err, data) {
// When the node does not exists/is empty, you will get data ===
// undefined
});

If you just want to know when a node is created/available, you can use
client.pathExists

client.pathExists('', function(err, exists) {
// exists will be true/false
// it is used internally by uwatch
});

Boths returns an object with a stop() function

Because in some cases you would want to stop() watching.

var watch = client.uwatch/pathExists...

Later on.. watch.stop();

If you have any advice or want to add/remove something, tell me. Also I will update the docs if we merge this.