To install @hikyu/env, run the following command:
npm install @hikyu/env
To use the package, require it in your project like so:
require('@hikyu/env')(); // Path default to ./.env
require('@hikyu/env')('./.myEnv'); // File path is optional
text=My Variable Text
anyNumber=1
Using global.env
console.log(global.env.text)
// Output: My Variable Text
console.log(env.anyNumber) // global is not needed (use only if no other env variable exists)
// Output: 1
Using proces.env
console.log(process.env.text)
// Output: My Variable Text
This package is licensed under the MIT License.