New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

dotenv-ts

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dotenv-ts

load environment variables from .env file, into process.env

latest
Source
npmnpm
Version
0.2.1
Version published
Weekly downloads
5
-54.55%
Maintainers
1
Weekly downloads
 
Created
Source

dotenv-ts

load environment variables from .env file, into process.env

NPM Version

Install

in production mode, use real environment variables instead

npm i -D dotenv-ts

Usage

require('dotenv-ts').config()

or with options

require('dotenv-ts').config(options)

Options

KeyrequiredTypeDefaultDescription
dirnamenostringprocess.cwd()path to find .env file
modenostringprocess.env.NODE_ENV or "dev"mode to determine additional .env file's name. one of prod, dev, test, debug
canOverwritenobooleanfalsespecify whether .env variables can overwrite process.env. if not, conflicting key will logged and not applied.
priorityyes"local" or "mode" or undefined"local"determines which file's value will be used when .env.${mode} and .env.local has same key. if unspecified(undefined) and has conflicting key, error will thrown
variablesnoObjectprocess.envkey-value store for variables - used to resolve variables
shareVariablesyesbooleantrueshare variables cross file (can reference variable in another file)

Required options' default value is used if no option provided.

WARN: If option object is passed but required option is not set, the value will be undefined which can lead to unexpected behavior

Feature

load environment variable from .env file into process.env

supports multiline and variable resolution also

Notice

There may be any breaking changes before the first stable version.

License

MIT

Keywords

dotenv

FAQs

Package last updated on 01 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts