0.1.2 • Published 11 years ago
configrc v0.1.2
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');
// login <- 'jack'
// password <- '123456'Destroying the config
'use strict';
var myconf = require('configrc').make('myapp');
myconf.destroy();Deletes the config file ~/.myapprc.
License
MIT