# babel-plugin-dotenv2

> Load environment variables from .env file using import statement

Latest version **0.1.1** (published 2020-03-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-dotenv2
pnpm add babel-plugin-dotenv2
yarn add babel-plugin-dotenv2
bun add babel-plugin-dotenv2
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2020-03-10 |
| First published | 2020-03-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 9.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | David Chang |
| Maintainers | robbie-c |
| Keywords | dotenv, babel-plugin |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-dotenv2
- npm.io page: https://npm.io/package/babel-plugin-dotenv2

## Dependencies (1)

- [dotenv](https://npm.io/package/dotenv.md) ^2.0.0

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2020-03-10

## README

# babel-plugin-dotenv

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

## Installation

```sh
$ npm install babel-plugin-dotenv
```

## Usage

**.babelrc**

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

**.env**

```
DB_HOST=localhost
DB_USER=root
DB_PASS=s1mpl3
```

In **whatever.js**

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

---
_Source: https://npm.io/package/babel-plugin-dotenv2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
