config-rc
Simple .*rc
configuration module designed for command line applications.
Example
Setting values
'use strict';
var myconf = require('configrc').make('myapp');
myconf.set('login', 'jack');
myconf.set('password', '123456');
Saves in ~/.myapprc
the following JSON:
{
"login": "jack",
"password": "123456"
}
Retrieving values
'use strict';
var myconf = require('configrc').make('myapp');
var login = myconf.get('login'),
password = myconf.get('password');
Destroying the config
'use strict';
var myconf = require('configrc').make('myapp');
myconf.destroy();
Deletes the config file ~/.myapprc
.
License
MIT