dotenv language preview
1. Application config
comments, keys, and values
horizon-dark
# application environment
NODE_ENV=production
PORT=8080
DEBUG=false
APP_NAME=svelte-highlight atom-one-dark
# application environment
NODE_ENV=production
PORT=8080
DEBUG=false
APP_NAME=svelte-highlight github-dark
# application environment
NODE_ENV=production
PORT=8080
DEBUG=false
APP_NAME=svelte-highlight dracula
# application environment
NODE_ENV=production
PORT=8080
DEBUG=false
APP_NAME=svelte-highlight nord
# application environment
NODE_ENV=production
PORT=8080
DEBUG=false
APP_NAME=svelte-highlight github
# application environment
NODE_ENV=production
PORT=8080
DEBUG=false
APP_NAME=svelte-highlight 2. Quoting and interpolation
quoted values and variable references
horizon-dark
HOST=localhost
PORT=5432
DATABASE_URL="postgres://${HOST}:${PORT}/app"
GREETING='literal $not-expanded value'
PATH_EXTRA="${HOME}/bin" atom-one-dark
HOST=localhost
PORT=5432
DATABASE_URL="postgres://${HOST}:${PORT}/app"
GREETING='literal $not-expanded value'
PATH_EXTRA="${HOME}/bin" github-dark
HOST=localhost
PORT=5432
DATABASE_URL="postgres://${HOST}:${PORT}/app"
GREETING='literal $not-expanded value'
PATH_EXTRA="${HOME}/bin" dracula
HOST=localhost
PORT=5432
DATABASE_URL="postgres://${HOST}:${PORT}/app"
GREETING='literal $not-expanded value'
PATH_EXTRA="${HOME}/bin" nord
HOST=localhost
PORT=5432
DATABASE_URL="postgres://${HOST}:${PORT}/app"
GREETING='literal $not-expanded value'
PATH_EXTRA="${HOME}/bin" github
HOST=localhost
PORT=5432
DATABASE_URL="postgres://${HOST}:${PORT}/app"
GREETING='literal $not-expanded value'
PATH_EXTRA="${HOME}/bin" 3. Exported variables
export prefix and secrets
horizon-dark
export AWS_REGION=us-east-1
export API_TOKEN="sk_live_0123456789"
# feature flags
ENABLE_CACHE=true
MAX_RETRIES=3 atom-one-dark
export AWS_REGION=us-east-1
export API_TOKEN="sk_live_0123456789"
# feature flags
ENABLE_CACHE=true
MAX_RETRIES=3 github-dark
export AWS_REGION=us-east-1
export API_TOKEN="sk_live_0123456789"
# feature flags
ENABLE_CACHE=true
MAX_RETRIES=3 dracula
export AWS_REGION=us-east-1
export API_TOKEN="sk_live_0123456789"
# feature flags
ENABLE_CACHE=true
MAX_RETRIES=3 nord
export AWS_REGION=us-east-1
export API_TOKEN="sk_live_0123456789"
# feature flags
ENABLE_CACHE=true
MAX_RETRIES=3 github
export AWS_REGION=us-east-1
export API_TOKEN="sk_live_0123456789"
# feature flags
ENABLE_CACHE=true
MAX_RETRIES=3 4. Parameter expansion defaults
${VAR:-default}, ${VAR:=default}, and ${VAR:+alt}
horizon-dark
PORT=${PORT:-3000}
DATABASE_URL=${DATABASE_URL:=postgres://localhost/app}
FEATURE_FLAG=${FEATURE_FLAG:+enabled} atom-one-dark
PORT=${PORT:-3000}
DATABASE_URL=${DATABASE_URL:=postgres://localhost/app}
FEATURE_FLAG=${FEATURE_FLAG:+enabled} github-dark
PORT=${PORT:-3000}
DATABASE_URL=${DATABASE_URL:=postgres://localhost/app}
FEATURE_FLAG=${FEATURE_FLAG:+enabled} dracula
PORT=${PORT:-3000}
DATABASE_URL=${DATABASE_URL:=postgres://localhost/app}
FEATURE_FLAG=${FEATURE_FLAG:+enabled} nord
PORT=${PORT:-3000}
DATABASE_URL=${DATABASE_URL:=postgres://localhost/app}
FEATURE_FLAG=${FEATURE_FLAG:+enabled} github
PORT=${PORT:-3000}
DATABASE_URL=${DATABASE_URL:=postgres://localhost/app}
FEATURE_FLAG=${FEATURE_FLAG:+enabled}