🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

load-dotenv

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

load-dotenv

Find the closest .env file

Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
222
50%
Maintainers
1
Weekly downloads
 
Created
Source

Load Dot ENV

Find the closest .env file in any parent directory.

Install

npm i dotenv load-dotenv     # With npm
pnpm i dotenv load-dotenv    # With pnpm
yarn add dotenv load-dotenv  # With yarn

Find and load the closest .env file

import 'load-dotenv/load';

Or load it yourself

Add this import before any other import in your project:

import findEnv from 'load-dotenv';

const envFile = findEnv();
require('dotenv').config({ path: envFile });

FAQs

Package last updated on 28 Apr 2023

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