Shell Script Reader
Shell Script Reader provides a way to read user customized shell script where a lot of enviromental vairables are defined.
So you can easily share your shell variables with your node.js scripts.
Instead of using a central process.env, you can use your enviromental variable sets for each projects respectively. These way you will be eased by multiple projects and tests for various configurations.
And still you can easily interacting with shell vairaibles.
Install
npm install --save shell-script-reader
Usage
Import
;
Initialize
;;;
env
file example:
export AAA=111export BBB=sosoisidoeodexport ENV=E-SS OSexport UN=export UN=aaasossos=aaaexport AAAAAexportexport # SHELL COMMENTS wget https://www.google.com
Only
^export
stated lines are read.
We will have an env object:
Read process.env
It provides access to process.env for convenience sake.
;
Read Script Variables
;
For ./env
script defined above:
;// '111';// 'sosoisidoeod'
If no key is provided, the whole object will be returned:
;// { AAA: '111',// BBB: 'sosoisidoeod',// ENV: 'E-SS OS',// UN: '',// AAAAA: '' }
License
The MIT License (MIT)