1.0.3 • Published 4 years ago

env.macro v1.0.3

Weekly downloads
551
License
MIT
Repository
github
Last release
4 years ago

env.macro

Babel macro that inlines environment variables if they exist at compile-time, otherwise deferring to insertion at runtime.

Installation

npm i -D env.macro

Usage

import env from 'env.macro'
const variable = env('ENV VAR')

if 'ENV VAR' exists at compile time transforms to:

const variable = 'Value'

otherwise:

const variable = process.env['ENV VAR']