Parse a .env file into key-value pairs while respecting quotes and comments.
The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.
Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.
Lines split at the first unquoted equals sign, whitespace is trimmed, comments outside quotes are ignored, and quoted values are unwrapped. The result is a map and does not mutate process environment variables.
# Database DB_HOST=localhost DB_PORT=5432 DB_NAME="myapp"
Count: 3 Comments: 1 Keys: DB_HOST, DB_PORT, DB_NAME VARIABLES Db host: localhost Db port: 5432 Db name: myapp
Node apps, CI previews, and local development setups parse .env files.