1.0.10 • Published 1 year ago

@hikyu/env v1.0.10

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

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

Usage

Creating file

text=My Variable Text
anyNumber=1

Getting variables

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

License

This package is licensed under the MIT License.