0.1.3 • Published 6 years ago

argv-config-file v0.1.3

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

Argv Config File

Pass a js or json configuration file on the command line to a Node.js application. Configuration merging is done using config-extend.

Install

npm install --save argv-config-file

Usage

app.js

const argvConfigFile = require('argv-config-file');

let config = argvConfigFile({
	// Default config
	// Extended using the file passed on the command line
	foo: ['bar'],
	biz: 'baz'
});

my-config.js

module.exports = {
	// Custom config
	foo: ['array', 'override']
}

my-config.json

{
	"foo": ["array", "override"]
}

Run

node app.js -c /some/directory/my-config.js
node app.js --config=/some/directory/my-config.json

Config Value

{
	foo: ['array', 'override'],
	biz: 'baz'
}
0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago