A simple Node.js settings library.
Install setting
npm install setting
Create file demo.js
var setting = require('setting')
setting('mysql', 'host', 'localhost')
setting('mysql', 'port', 3306)
setting('mysql', 'user', 'root')
setting('mysql', 'password', 'secret')
console.log(setting.mysql)
Run demo.js
[silas@host ~]$ MYSQL_PORT=3307 node demo.js --mysql-user=test
{ host: 'localhost',
port: 3307,
user: 'test',
password: 'secret' }
This work is licensed under the MIT License (see the LICENSE file).