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

env-import

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

env-import

Import environment variables with dotenv in an absolute import using ES6 import syntax

latest
Source
npmnpm
Version
0.1.3
Version published
Maintainers
1
Created
Source

env-import

Configure environment variables with dotenv in one absolute import using ES6 import syntax.

I made this because ESLint was complaining about my enviroment variables configuration file relative import being before the absolute imports

// import dotenv in env.js file and run dotenv.config() there
import './env';
// other absolute imports

or any code being before imports

import dotenv from 'dotenv';
dotenv.config();
// other absolute imports

and some of dependecies rely on environment variables being configured to function properly (like api-error-handler in here)

Usage

// With .env in your root directory

import 'env-import'

// Now all environment variables are configured

FAQs

Package last updated on 26 Jul 2017

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