@blued-core/zookeeper-client
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

zookeeper-client

提供几个常用的 API: getData, setData getChildren

getData

console.log(await client.getData('/patha/pathb'))

setData

await client.setData('/patha/pathb', 123)
console.log(await client.getData('/patha/pathb')) // => 123

getChildren

console.log(await client.getChildren('/patha')) // => ['pathb', 'pathc']

create

await client.create('/patha/pathb', 1)
await client.create('/patha/pathc', 2)
console.log(await client.getChildren('/patha')) // => ['pathb', 'pathc']
console.log(await client.getData('/patha/pathb')) // => '1'
console.log(await client.getData('/patha/pathc')) // => '2'

remove

await client.create('/patha/pathb', 1)
await client.create('/patha/pathc', 2)
await client.remove('/patha/pathc')
console.log(await client.getChildren('/patha')) // => ['pathb']
console.log(await client.getData('/patha/pathb')) // => '1'

exists

await client.create('/patha/pathb', 1)
console.log(await client.exists('/patha/pathb')) // => true
console.log(await client.exists('/patha/pathc')) // => false

mkdirp

await client.mkdirp('/patha/pathb')
console.log(await client.exists('/patha/pathb')) // => true
console.log(await client.exists('/patha/pathc')) // => false

Readme

Keywords

none

Package Sidebar

Install

npm i @blued-core/zookeeper-client

Weekly Downloads

4

Version

1.0.6

License

ISC

Unpacked Size

16.4 kB

Total Files

6

Last publish

Collaborators

  • jarvan8888
  • jiasm
  • ryli
  • nieweidong
  • fengcang2020