consult
v1.0.1
Published
Simple wrapper arround Consul to cache the key/value store
Downloads
117
Readme
Consul Key/Value reader
A simple node.js wrapper arround Consul, currently focused in storing and getting persistent key/values.
Installation
npm install consult
Usage
- Install Consul in your VM.
- The library will connect an existing Consul installation.
- (optional) In the package folder run
node test
to verify that Consul is accessible - Include it into your app!
Example
const consulkv = require('consult'),
consult = consult.consult;
// Pre-fill local cache with current values at server start
consulkv.init(["key1", "key2", "key3", ...]);
// As a featureToggler, use it as follows:
if (consult("this") === "on") {
// Code of the feature turned on
// ...
}