Skip to content

borabaloglu/load-env-var

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

load-env-var

A helper module for loading environment variables

Install

$ npm i load-env-var

Usage

Import
const envLoader = require("load-env-var");

// or

import envLoader from "load-env-var";
Load Number
envLoader.loadNumber("PORT", {
  allowNaN: false,
  allowInfinity: false,
  defaultValue: 5000,
});
Load String
envLoader.loadString("JWT_SERCRET", {
  defaultValue: "thiskeyissecret",
});
Load Array
envLoader.loadArray("NAMES", {
  type: "string",
  delimiter: ",",
});
Load Boolean
envLoader.loadBoolean("ALLOW_HTTP", {
  defaultValue: false,
});

About

A helper module for loading environment variables

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published