Skip to content
configkit

Why .env values stay strings

A .env file does not carry types. ConfigKit keeps the characters you wrote, and it refuses to invent a value for a $ reference.

The example

Digits and the words true and false stay strings. The converter says so. The validator checks the same lines and does not write JSON.

PORT=8080
DEBUG=false

The JSON is {"PORT":"8080","DEBUG":"false"}. Nothing is turned into a number or a boolean.

The edge case

$NAME and ${NAME} are errors. They are not expanded from the environment or from earlier keys. A duplicate key is also an error, reported on the later line, and no JSON is written.

HOST=$HOME
PORT=8080
PORT=9090

Try it on ENV to JSON or the ENV validator.