1.0.6 • Published 4 years ago

@blued-core/zookeeper-client v1.0.6

Weekly downloads
4
License
ISC
Repository
-
Last release
4 years ago

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
1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago