cl

config.local

Using app config setting. Config in different environments is different.

Showing:

Popularity

Downloads/wk

3

GitHub Stars

2

Maintenance

Last Commit

4yrs ago

Contributors

1

Package

Dependencies

2

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

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"
    }
}
*/

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial