0.1.0 • Published 12 years ago

configm v0.1.0

Weekly downloads
2
License
-
Repository
github
Last release
12 years ago

configm

merging your config

installation

npm install configm

usage

var configm = require('configm')('sample.json', process.env.HOME);

initialize configm - the config will be saved to sample.json and process.env.HOME will be used as global directory

configm.set({ key: value }, callback);
// equals
configm.set('key', value, callback);

applies the object/keyvalue pair to the config at the local directory

configm.set(key, value, 'g', callback);

applies the keyvalue pair to the global directory

configm.get([dir], callback)

gets the config. dir defaults to current working directory

+-- HOME (global)
    +-- sample.json
        { a: 1, b: 2, c: 3 }

+-- Parent
    +-- sample.json
    |   { b: 3, c: 4, d: 5 }
    |
    +-- workingDir
        +-- sample.json
            { c: 5, d: 6, e: 7 }

will return {a:1, b:3, c:5, d:6, e:7}

0.1.0

12 years ago

0.0.0

12 years ago