NTreeConfig
Configuration file with multiple inheritance of group properties and using relative Unix paths
Quick Start
$ npm install ntreeconfig$ cd node_modules/ntreeconfig$ npm install$ npm test
Example
File "config1.json":
postgres: main: port: 123 user: "user1" password: "pass1" key4: 4 local: inherit: "../main" host: "localhost" database: "db1" remote: inherit: "../main" database: "db2" key3: 3 pc3: inherit: "../remote" host: "ip2" key1: 1 pc3: inherit: "..//postgres/pc3" key0: 0
Using the file "config1.json":
; //...const config = await ; config; // -> 123config; // -> 123 config;// -> key0: 0 host: 'ip2' key1: 1 database: 'db2' key3: 3 port: 123 user: 'user1' password: 'pass1' key4: 4
API
; ; NTreeConfig:getValuekeys: PathUnix | OneOrArray<ObjectKeyType>, valueDefault?: any: any;NTreeConfig:getObjectkeys: OneOrArray<ObjectKeyType>: object;
Advanced
Full config file (*.json)
Full module tests (*.ts)