con

consulr

Decode Consul KV data into JSON in Node.js and watch for updates

Showing:

Popularity

Downloads/wk

9

GitHub Stars

11

Maintenance

Last Commit

10mos ago

Contributors

2

Package

Dependencies

3

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

consulr

Build Status Coverage Status npm version NPM

Decode Consul KV data into JSON in Node.js and watch for updates!

Consul is a tool for service discovery, monitoring and configuration. https://www.consul.io/

Important
⚠️⚠️⚠️ Purpose of this project to give extra capabilities to nodejs applications like dynamic configuration changes without SIGHUP signal or manuel restart. So, different solutions have own benefits; this means there is no claim to use consulr instead of file based configuration solutions like consul-template or environment variables based solutions envconsul.

Install with npm

npm i consulr --save

Install with yarn

yarn add consulr

Preview

const Consulr = require('consulr');

function main() {
  const c = new Consulr({
    prefix: "foo/",
    quiescencePeriodInMs: 3 * 1000 // 3 sec
  });

  c.on('update', newValue => {
    console.log(`New value : ${JSON.stringify(newValue)}`);
  });
  
  c.on('error', err => {
    console.log(`Error value : ${JSON.stringify(err)}`);
  });
  
  c.run();
}

main();

Development

It uses yarn for dependency management.

git clone git@github.com:ziyasal/consulr.git
cd consulr
yarn #it will install dependencies

Testing
It uses nock to intercept consul http calls in tests.

Bugs

If you encounter a bug, performance issue, or malfunction, please add an Issue with steps on how to reproduce the problem.

License

Code and documentation are available according to the MIT License (see LICENSE).

z i λ a s a l

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial