Options
All
  • Public
  • Public/Protected
  • All
Menu

node-zk-treecache

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

Generated using TypeDoc