https://github.com/zhex/config-stone-node-client
https://github.com/zhex/config-stone-node-client
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/zhex/config-stone-node-client
- Owner: zhex
- Created: 2018-07-25T22:33:08.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-26T06:49:58.000Z (almost 8 years ago)
- Last Synced: 2025-01-16T10:31:08.687Z (over 1 year ago)
- Language: TypeScript
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# config-stone-node-client
get a profile from the config server
```js
const Client = require('./dist/index').default;
const client = new Client('http://localhost:3000');
client.getProfile('crypto-sentinel', 'default').then(console.log);
```
watch the config change
```js
const Client = require('./dist/index').default;
const client = new Client('http://localhost:3000');
const watcher = client.watch('crypto-sentinel', 'default');
watcher.on('start', data => {
console.log(data);
});
watcher.on('change', data => {
console.log(data);
});
watcher.on('close', () => {
console.log('watch closed');
});
```
### TODO
- [] profile on 'delete' handle