Socket
Socket
Sign inDemoInstall

babel-plugin-dotenv

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

babel-plugin-dotenv

Load environment variables from .env file using import statement


Version published
Weekly downloads
4.3K
increased by7.16%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-dotenv

Loads environment variables from a .env file through import statement.

Installation

$ npm install babel-plugin-dotenv

Usage

.babelrc

{
  "plugins": [["babel-plugin-dotenv", {
      "replacedModuleName": "babel-dotenv"
   }]]
}

.env

DB_HOST=localhost
DB_USER=root
DB_PASS=s1mpl3

In whatever.js

import { DB_HOST, DB_USER, DB_PASS } from "babel-dotenv"
db.connect({
  host: DB_HOST,
  username: DB_USER,
  password: DB_PASS
});

Keywords

FAQs

Package last updated on 14 Jan 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc