config.local
using set local config.
Last updated 3 years ago by dove8023 .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install config.local 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.3                                ...           latest (2 years ago)

4 Versions

  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 3
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |