Skip to content

arcturus/yajsonfig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yajsonfig

Build Status Coverage Status

Jet Another simple json configuration package for your projects.

Usage

const config = require('yajsonfig')(__dirname + '/config.json');

console.log('My configuration is ', config);

Extras

Not many.

You can overwrite the values of the json file based on environment variables.

For example, given the following json file:

{
  "port": 3000,
  "directory": "/tmp/var"
}

Setup the environment variable SIMPLECONFIG to a prefix of your choice:

export SIMPLECONFIG='MY_PROJECT_'

And then setup as many variables as you want:

export MY_PROJECT_DIRECTORY=/tmp/another

Your config object will come like:

{
  "port": 3000,
  "directory": "/tmp/another"
}

About

Simple nodejs configuration via json file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published