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

viqueen/fileconfig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quality Gate Status

fileconfig (v-4.0.0)

Library for configuration file loading

install it

npm install fileconfig -g

use it

assuming you have a configuration folder as follow:

+ /path/to/config/folder
    + share
        default.yml -> symlink to dev/alpha.yml
        + qa
        + dev
            alpha.yml

with this content

  • share/dev/alpha.yml
name: "alpha dev share"
port: 9090
dir: ${env.ALPHA_SHARE}

then you can fetch data as follow:

var FileConfig = require("fileconfig");
var config = new FileConfig("/path/to/config/folder");

var defaultServer = config.share.default;
console.log(defaultServer.name); // out : alpha dev share
console.log(defaultServer.port); // out : 9090

dev

npm run test:watch          # run tests and watch for changes
npm run lint                # generate lint report

licence

Apache-2.0

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published