Skip to content

Opinionated extraction of values from consul kv store for node.

License

Notifications You must be signed in to change notification settings

shrm-org/consul-kiev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

consul-kiev

Opinionated extraction of values from consul kv store for node.

Install

npm install consul-kiev

Test

npm test

Usage

let c = new consulKiev('localhost');
c.getValues('foo/bar', (err, results) => {
  // check err, use results
});

or using promises:

let c = new consulKiev('localhost');
c.getValues('foo/bar').then(results => {
  // use results
}).catch(err => {
  // handle err
});

cli:

$ consul-kiev -h
Usage:
  consul-kiev --server <server> --port <port> --key <key> --watch <output file>
  consul-kiev -k <key>
  consul-kiev -s <server> -k <key> -w <output file>

$ consul-kiev -k foo/bar
{
  baz: "figz"
}

API

getValues(key, [callback])

  • Extracts from consul recursively from given key
  • Transforms values within consul based on types
  • Supports arrays via JSON within consul values (very hackish; subject to change)
  • callback(err, results)
    • results is an object based on key/values

License

MIT. Copyright 2017-2018: SHRM, Brian Moelk

About

Opinionated extraction of values from consul kv store for node.

Resources

License

Stars

Watchers

Forks

Packages

No packages published