Skip to content

A dead simple package for getting environment variables

Notifications You must be signed in to change notification settings

malware-moon/get-env-variable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Get environment variable

A dead simple package for getting environment variables.

Getting started

Installation

npm i get-env-variable

Usage

Both export and default export are available

import { getEnvironmentVariable } from 'get-env-variable'

// With default value
// This will return 3000 if PORT environment variable does not exists
const PORT = Number(getEnvironmentVariable('PORT', '3000'))

// Without default value
// This will throw error if PORT environment variable does not exists
const PORT = Number(getEnvironmentVariable('PORT'))

About

A dead simple package for getting environment variables

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published