node-zk-treecache

[![Greenkeeper badge](https://badges.greenkeeper.io/fmonniot/node-zookeeper-treecache.svg)](https://greenkeeper.io/) [![Travis](https://img.shields.io/travis/fmonniot/node-zookeeper-treecache.svg)](https://travis-ci.org/fmonniot/node-zookeeper-treecache)


License
MIT
Install
npm install node-zk-treecache@1.0.1

Documentation

ZooKeeper TreeCache for node.js

Greenkeeper badge Travis Coveralls Dev Dependencies

A node.js port of the TreeCache Java Curator recipe.

Usage

The ZooKeeper client is not provided by the library, so you need to install it yourself with npm i node-zk-treecache. Then it is as simple as:

import { createClient, Client } from "node-zookeeper-client"
import { treeCacheBuilder, TreeCache } from "node-zk-treecache"

const client = createClient('localhost:2181')
client.connect()
const treeCache = treeCacheBuilder(client, '/root')

treeCache.addListener((client, event) => {
  // do something with the events
})

const map = treeCache.getCurrentChildren('/root/path')

The complete documentation is available online at https://francois.monniot.eu/node-zookeeper-treecache