1.0.1 • Published 7 years ago

consult v1.0.1

Weekly downloads
44
License
MIT
Repository
github
Last release
7 years ago

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

  1. Install Consul in your VM.
  2. The library will connect an existing Consul installation.
  3. (optional) In the package folder run node test to verify that Consul is accessible
  4. 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
	// ...
}
1.0.1

7 years ago

1.0.0

7 years ago