fatima

Dotenv

Load local dotenv files with the file provider.

Provider names: file, local.

{ "provider": "file", "file": ".env", "format": "env" }

Options

OptionMeaning
fileA single path or array of paths.
filesA path or array of paths.
formatOnly env is supported.

If no file option is provided, Fatima reads .env.

Multiple files

{
  "provider": "file",
  "files": [".env", ".env.local"]
}

Files are loaded in order. Later files override earlier values with the same key.

Supported syntax

The parser accepts:

  • KEY=value
  • export KEY=value
  • single-quoted values
  • double-quoted values
  • backtick-quoted values
  • comments and empty lines

Double-quoted values decode \n and \r.