s-config
Config from file in constant
installation
npm i s-config --save
Basic usage:
var config = 'config-id' './path/to/source/config.json';
Constant:
var config = 'config-id' './path/to/source/config.json'; // it isn't the same object, but it equal of originvar assert = ;assert;
Note: Emulation of constant - prevents change of field values in the configuration at runtime.
Merge-config :
var config = 'config-id' './config.env' // minimum priority './config.json' some: 'hardcode' './environment/db.json' another: 'hardcode' // maximum priority ;
Note: Find you way to create the present huge configs and methods of management.
Read:
var configMap = ;// only read config without adding to config mapvar config1 = configMap;// only read config without adding to config mapvar config2 = configMap; // Emulation of the "dotenv" approach// read of environment variable from '.env' and write it in processObject;// expand of environment variable from environment fileObject;
Note: The file extension is required for any method of reading config.