# dotenv.macro

> Inline dotenv at build-time with babel-macros.

Latest version **1.0.0** (published 2018-01-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install dotenv.macro
pnpm add dotenv.macro
yarn add dotenv.macro
bun add dotenv.macro
```

## Health

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

Positive: no vulnerabilities; high maintenance score.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-01-18 |
| First published | 2018-01-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=9.0.0 |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Michael Hsu |
| Maintainers | evenchange4 |

## Links

- npm: https://www.npmjs.com/package/dotenv.macro
- Repository: https://github.com/evenchange4/dotenv.macro
- Homepage: https://github.com/evenchange4/dotenv.macro#readme
- Issues: https://github.com/evenchange4/dotenv.macro/issues
- npm.io page: https://npm.io/package/dotenv.macro

## Dependencies (3)

- [dotenv](https://npm.io/package/dotenv.md) 4.0.0
- [dotenv-expand](https://npm.io/package/dotenv-expand.md) 4.0.1
- [babel-plugin-macros](https://npm.io/package/babel-plugin-macros.md) 2.0.0

## Recent versions

- 1.0.0 (latest) — 2018-01-18
- 0.1.1 — 2018-01-18
- 0.1.0 — 2018-01-18

## README

# dotenv.macro

> Inline dotenv at build-time with babel-macros.

[![Travis][build-badge]][build]
[![Codecov Status][codecov-badge]][codecov]
[![npm package][npm-badge]][npm]
[![npm downloads][npm-downloads]][npm]
[![node][node]]()

[![Dependency Status][dependency-badge]][dependency]
[![devDependency Status][devdependency-badge]][devdependency]
[![peerDependency Status][peerdependency-badge]][peerdependency]

[![prettier][prettier-badge]][prettier]
[![license][license-badge]][license]

## Installation

```sh
$ yarn add dotenv.macro
```

> Note: You'll also need to install and configure [babel-plugin-macros](https://github.com/kentcdodds/babel-plugin-macros) if you haven't already.

## Usage

```js
// .env
HOST=localhost
EXPAND_NODE_ENV="NODE_ENV=${NODE_ENV}"

// index.js
import { HOST } from 'dotenv.macro';
console.log(HOST);

      ↓ ↓ ↓ ↓ ↓ ↓

console.log(process && process.env && process.env.HOST || "localhost");
```

## Alternative

* [babel-plugin-inline-dotenv](https://github.com/brysgo/babel-plugin-inline-dotenv)

## Development

### Requirements

* node >= 9.4.0
* yarn >= 1.3.2

```sh
$ yarn install --pure-lockfile
```

## Test

```sh
$ yarn run format
$ yarn run eslint
$ yarn run test:watch
$ yarn run build
```

---

## CONTRIBUTING

* ⇄ Pull requests and ★ Stars are always welcome.
* For bugs and feature requests, please create an issue.
* Pull requests must be accompanied by passing automated tests.

## [CHANGELOG](CHANGELOG.md)

## [LICENSE](LICENSE)

MIT: [http://michaelhsu.mit-license.org](http://michaelhsu.mit-license.org)

[build-badge]: https://img.shields.io/travis/evenchange4/dotenv.macro/master.svg?style=flat-square
[build]: https://travis-ci.org/evenchange4/dotenv.macro
[npm-badge]: https://img.shields.io/npm/v/dotenv.macro.svg?style=flat-square
[npm]: https://www.npmjs.org/package/dotenv.macro
[codecov-badge]: https://img.shields.io/codecov/c/github/evenchange4/dotenv.macro.svg?style=flat-square
[codecov]: https://codecov.io/github/evenchange4/dotenv.macro?branch=master
[node]: https://img.shields.io/node/v/dotenv.macro.svg?style=flat-square
[npm-downloads]: https://img.shields.io/npm/dt/dotenv.macro.svg?style=flat-square
[license-badge]: https://img.shields.io/npm/l/dotenv.macro.svg?style=flat-square
[license]: http://michaelhsu.mit-license.org/
[dependency-badge]: https://david-dm.org/evenchange4/dotenv.macro.svg?style=flat-square
[dependency]: https://david-dm.org/evenchange4/dotenv.macro
[devdependency-badge]: https://david-dm.org/evenchange4/dotenv.macro/dev-status.svg?style=flat-square
[devdependency]: https://david-dm.org/evenchange4/dotenv.macro#info=devDependencies
[peerdependency-badge]: https://david-dm.org/evenchange4/dotenv.macro/peer-status.svg?style=flat-square
[peerdependency]: https://david-dm.org/evenchange4/dotenv.macro#info=peerDependencies
[prettier-badge]: https://img.shields.io/badge/styled_with-prettier-ff69b4.svg?style=flat-square
[prettier]: https://github.com/prettier/prettier

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