1.0.3 • Published 6 years ago

config.local v1.0.3

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

config.local

install

npm install --save config.local

description

In different enviornments, projects need different config setting. Maybe most config setting is same, but sometimes always has something need special setting. For example, the database on the production config setting is different with the test enviornment or your local envoirnment. The key is the same, but the value maybe not.

how to use

let config = require("config.local");
console.log(config);

file structure

  • config folder on the root director.
  • config.json file in the config folder.
  • config.local.json file in the config folder.

eg:

config.json

{
    "name":"Simth",
    "work":{
        "city":"Beijing",
        "company":"IT",
        "hisname":"{{name}}"
    }
}

config.local.json

{
    "name":"Amy",
    "work":{
        "city":"NewYork",
    },
    "sex":"man"
}

using in the project.

let config = require("config.local");
console.log(config);
/* 
{
    "name":"Amy",
    "work":{
        "city":"NewYork",
        "company":"IT",
        "hisname":"Amy"
    }
}
*/
1.0.3

6 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago