2.0.0 • Published 6 years ago

node-app-config v2.0.0

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

node-app-config

Simple class that parses a config json file and exposes the contents on the class

Requires Node v6.x +

typescript friendly

##install

$npm install node-app-config

##usage

var AppConfig = require('node-app-config');

var config = new AppConfig(); //this will work if your config is in the process.cwd() and the file is named config.json

console.log(config.mySetting);
console.log(process.appConfig.mySetting);

alternatively you can specify a config file path in the constructor

var AppConfig = require('node-app-config');

//this config file path can be relative to process.cwd()
//to use an absolute path use new AppConfig([path], false);
var config = new AppConfig('../path/to/config');

console.log(config.mySetting);
console.log(process.appConfig.mySetting);

ERRORS

the object constructor will throw exceptions if the config file does not exist or is invalid json

##license

MIT

2.0.0

6 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago