1.0.1 • Published 2 years ago

@chrysthopher/envars v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

envars

Instalation

npm i envars --save

Usage

# Web development
PORT=8080

# Info about owner

NAME=MrChrys

# Module info

Module_Name=envars
Module_Desc=A module made to help you configure your enviroments variables

# It supports Spaces!

My precious token=no token found

# File: .env
//File: index.js

require("envars").config({ local: true })

console.log(process.cleanEnv)
/*
Expected output:
________
{
  PORT: 8080,
  NAME: 'MrChrys',                        Module_Name: 'envars',
  Module_Desc: 'A module made to help you configure your enviroments variables',
  'My precious token': 'no token found'
}
*/

Options

<local> Boolean

Determines if the env is into the folder where the actual script are

Example

// index.js is in commands/

require("envars").config({ local: true })
// it will set the process.env to the .env into the "commands/" folder instead of the root folder