Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dotenv.macro

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dotenv.macro

Inline dotenv at build-time with babel-macros.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

dotenv.macro

Inline dotenv at build-time with babel-macros.

Travis Codecov Status npm package npm downloads node

Dependency Status devDependency Status peerDependency Status

prettier license

Installation

$ yarn add dotenv.macro

Note: You'll also need to install and configure babel-plugin-macros if you haven't already.

Usage

// .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

Development

Requirements

  • node >= 9.4.0
  • yarn >= 1.3.2
$ yarn install --pure-lockfile

Test

$ 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

LICENSE

MIT: http://michaelhsu.mit-license.org

FAQs

Package last updated on 18 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