1.0.3 • Published 3 years ago

@jarraga/env-literal v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

🪂 env-literal

Based on https://www.npmjs.com/package/dotenv-expand

This package iterates the variables of the process.env object, and parses them as if it were a literal javascript string, and injects them back into the same object

For example:

BASE_URL=http://localhost:3000
API=${BASE_URL}/api

In this case, the API variable will have the value http://localhost:3000/api

Unlike dotenv or dotenv-expand, variables are read directly from the system environment and not from an .env file

Usage: as soon as possible, run the function:

const envLiteral = require("@jarraga/env-literal");

if (process.env.NODE_ENV === "production") {
  envLiteral(); // call envLiteral(true) for debugging
}
1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago