Skip to content

JHikyu/-hikyu-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published