tiny-conf-plugin-argv
v1.1.0
Published
tiny-conf plugin to load data from command-line arguments using `yargs-parser`
Downloads
8
Readme
tiny-conf-plugin-argv
Will store content of process.argv
to the given tiny-conf
store
Usage
const conf = require('tiny-conf');
require('tiny-conf-plugin-argv')(conf);
Example
Calling your app like this:
node /path/to/your/app.js --foo=bar --no-log --one.two tree
With /path/to/your/app.js
:
const conf = require('tiny-conf');
require('tiny-conf-plugin-argv')(conf);
// it will load argv params in store:
conf.get('foo'); // 'bar'
conf.get('log'); // false
conf.get('one.two'); // 'three'