Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

babel-plugin-dotenv

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

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
Maintainers
1
Created

Readme

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

Last updated on 14 Jan 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc