Skip to content

hdytsgt/dotcnf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

dotcnf

npm npm npm

Deadly simple environment variables for Node JS

Installation

npm install --save dotcnf

Usage

Create .cnf file in your project root directory and put your configuration with key=pair and new-line separated. Example :

APIKEY=zzz
APISECRET=yyy

Then in your app :

const config = require( 'dotcnf' )();
// Access config data
console.log( config.APIKEY );
console.log( config.APISECRET );

In case your .cnf file is not in your project root directory, you can pass parameter when require the file.

const config = require( 'dotcnf' )( '../../.cnf' );

License

MIT

About

Deadly simple environment variables.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published