Novice, Practiced, Mastered

    spmrc

    1.2.0 • Public • Published

    spmrc Build Status

    The rc manager for spm.


    Upgrade info for 1.x.x

    Now we use ~/.spm/spmrc-3x as default rc file for spm@3.x;

    Usage

    var spmrc = require('spmrc');

    spmrc is located at ~/.spm/spmrc-3x in ini format. An example:

    [user]
    username = spm
    
    [template:arale]
    url = http://aralejs.org/hello
    

    spmrc.get

    Get information in spmrc:

    spmrc.get('user')
    // {username: 'spm'}
     
    spmrc.get('user.username')
    // spm

    spmrc.set

    Set value in a section:

    spmrc.set('user.username', 'spmjs')

    spmrc.config

    A mix of get and set:

    spmrc.config('user.username')  // equal spmrc.get
    spmrc.config('user.username', 'spm')  // equal spmrc.set

    spmrc.parse

    Parse an ini file to object. Default file is ~/.spm/spmrc.

    spmrc.parse(file)
    // an object

    spmrc.write

    Write object to ~/.spm/spmrc.

    spmrc.write(obj)

    Changelog

    2013-03-26 1.0.0

    spmrc -> spmrc-3x.

    2013-03-26 0.1.3

    bugfix for windows. windows use process.env.HOMEPATH.

    2013-03-17 0.1.2

    spmrc has user.temp default value.

    2013-03-17 0.1.1

    spmrc has default values.

    2013-03-14 0.1.0

    First version.

    Keywords

    none

    Install

    npm i spmrc

    DownloadsWeekly Downloads

    41

    Version

    1.2.0

    License

    none

    Last publish

    Collaborators

    • lepture
    • afc163
    • sorrycc