node-zookeeper-client-async
A promises wrapper over https://github.com/alexguan/node-zookeeper-client
For the most part it has each method included in the original node-zookeeper-client, with
each method with a callback having an additional Async
variant (e.g. createAsync
).
The symantics are slightly different in that operations on nonexistant nodes typically do
not reject (i.e. return an error), but rather resolve null
.
Documentation
For more specific information see the documentation
Example
const zk = ; { const client = zk; // connect to the server await client; console; // create a node const rootPath = await client; console // add some ephemeral nodes await client; await client; // list the nodes const nodes = await client; // print stuff to console console await Promiseallnodes; // delete everything await client; // shut down await client; console;};
Console output:
~/node-zookeeper-client-async$ node example.js
connected!
created /test
/test has the children:
counter-0000000000: first
counter-0000000001: second
disconnected