0.1.0 • Published 6 years ago
confolder v0.1.0
confolder
Simple lib for getting configuration in nodejs applications I prefer split configuration by files and all process variables should be loaded from .env file
Usage example
app structure example
- app
- config
- session.js
- mongo.js
- rabbitmq.js
- facebook.js
... etc
- models
- controllers
.env
index.js
// somewhere in your code
const config = require('confolder');
app.use(session(config.get('session')));
or
app.use(session(config.session));
By default configuration will be loaded from config folder relative to current working directory of the Node.js process, if you whant to change it just provide NODE_CONFIG_FOLDER
env variable with path.
You can't modify this object, and set new props only read that was loaded from config folder