0.1.2 • Published 10 years ago

configrc v0.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

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

0.1.2

10 years ago

0.1.1

10 years ago