🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

env-fn

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

env-fn

Load environment variables from from local `.env` file

2.2.0
latest
Source
npm
Version published
Weekly downloads
2.4K
-54.86%
Maintainers
1
Weekly downloads
 
Created
Source

Env-fn

Load .env configuration

Usage

require("env-fn")()

require("env-fn")(".env")
require("env-fn")("special")

Typing

require("env-rn")(fileName: string)

Searches for fileName starting from process.cwd directory and moving up.

If it finds it, it loads environment variables in the process.

Only the first request load variables; the following calls do nothing.

Default value

  • fileName - .env

Pin to different directory

Default directory is process.cwd() To apply local directory as start point use 'dirname' as argument, which is upgrade upon special behaviour.

Forbid use through env flag

If your process.env.ENV_FLAG is different than undefined or 'true', then no environment variables will be loaded with this library.

FAQs

Package last updated on 28 Nov 2020

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