Skip to content
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.

Bonuspunkt/configm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

configm Build Status

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}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published