lego-modify
v0.0.3
Published
modify file content with lego init.
Downloads
10
Readme
legorc
The rc manager for lego.
Upgrade info for 1.x.x
Now we use ~/.lego/legorc
as default rc file for [email protected];
Usage
var legorc = require('legorc');
legorc is located at ~/.lego/legorc
in ini format. An example:
[user]
username = lego
[template:arale]
url = http://aralejs.org/hello
legorc.get
Get information in legorc:
legorc.get('user')
// {username: 'lego'}
legorc.get('user.username')
// lego
legorc.set
Set value in a section:
legorc.set('user.username', 'legojs')
legorc.config
A mix of get and set:
legorc.config('user.username') // equal legorc.get
legorc.config('user.username', 'lego') // equal legorc.set
legorc.parse
Parse an ini file to object. Default file is ~/.lego/legorc
.
legorc.parse(file)
// an object
legorc.write
Write object to ~/.lego/legorc
.
legorc.write(obj)
Changelog
2013-03-26 1.0.0
legorc
-> legorc
.
2013-03-26 0.1.3
bugfix for windows. windows use process.env.HOMEPATH
.
2013-03-17 0.1.2
legorc has user.temp
default value.
2013-03-17 0.1.1
legorc has default values.
2013-03-14 0.1.0
First version.