National Puppy Menace

    This package has been deprecated

    Author message:

    this package has been deprecated, use: let appConfig = require('path/to/config);

    node-app-config
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.0 • Public • Published

    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

    Install

    npm i node-app-config

    DownloadsWeekly Downloads

    16

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    8.93 kB

    Total Files

    13

    Last publish

    Collaborators

    • weagle08