Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 436 Bytes

File metadata and controls

19 lines (14 loc) · 436 Bytes

nodecloud-consul-config

Usage

import ConsulConfig from 'nodecloud-consul-config';
import Consul from 'consul';

const consul = new Consul(/* ignore */);
const config = new ConsulCOnfig(consul, 'user-service', process.env.NODE_ENV, {format: 'yaml'});

config.get('user.name', 'zhangsan').then(name => {
    console.log(name);
});

config.watch('user.name', 'zhangsan', (err, name) => {
    console.log(name);
});