Skip to main content

Module dotenv

Module dotenv 

Source
Expand description

Dotenv files as Nx reads them, with npm’s dotenv and dotenv-expand: every file of a set is parsed first, then $VAR and ${VAR} references are expanded once across all of them.

Functions§

load
Reads paths into env as Nx’s loadAndExpandDotEnvFile does. The files are merged first, the first to set a key winning; each key env does not hold is set; then each value is expanded against env and what the files expanded before it, and set, which also fills a variable set but empty. A variable env already holds with another value keeps it. A file that does not exist is skipped.
parse
The entries of one dotenv file, in order, as dotenv’s parse reads them: lines it cannot read are left out, a key given twice keeps its first place and its last value, quotes are removed, and \n and \r become line breaks inside double quotes. Nothing is expanded here.
read_alone
The variables of one file as load would set them in an empty environment: what Nx compares to unload a root dotenv file.