release notes
release notes
Published 1/29/2025
PatchContains breaking changesThe release essence: introduced full-featured .env support #461 → #1060 #1052 #1043 #1037 #1032 #1030 #1022
envapi is a tiny 100 LOC dotenv-inspired parser and serializer that we've integrated into zx.
import { dotenv, fs } from 'zx'
// parse
const env = dotenv.parse('A=A\nFOO=BAR') // { A: 'A', FOO: 'BAR' }
// serialize
const raw = dotenv.stringify(env) // A=A\nFOO=BAR
await fs.writeFile('.env', raw)
// load
dotenv.load('.env') // { A: 'A', FOO: 'BAR' }
// update the process.env
dotenv.config('.env')
process.env.A // A
zx --env .env script.mjs
zx --env-file .env script.mjs
— Why not use dotenv directly?
— 1) Size does matter 2) We'd like to avoid internal vaults.
— Why not load .env by default?
— 1) Explicit is better than implicit 2) Runtime itself (like bun) may provide the feature.
stdall piping #1033fullCmd and unique id #1035halt and run API in docs #1046timeout option handling for corner cases #1049killSignal setting via env vars #1054diagnostic_channel to built-ins list #1056id field and introduced end event #1057 #1058nothrown() toggleable #1066 #1029ZX_REPL_HISTORY envvar #1065file:// protocol check #1064mode option for tmpdir and tmpfile #1063_timeoutSignal override #1075ProcessPromise stage #1077 #967release notes
Published 1/29/2025
PatchContains breaking changesThe release essence: introduced full-featured .env support #461 → #1060 #1052 #1043 #1037 #1032 #1030 #1022
envapi is a tiny 100 LOC dotenv-inspired parser and serializer that we've integrated into zx.
import { dotenv, fs } from 'zx'
// parse
const env = dotenv.parse('A=A\nFOO=BAR') // { A: 'A', FOO: 'BAR' }
// serialize
const raw = dotenv.stringify(env) // A=A\nFOO=BAR
await fs.writeFile('.env', raw)
// load
dotenv.load('.env') // { A: 'A', FOO: 'BAR' }
// update the process.env
dotenv.config('.env')
process.env.A // A
zx --env .env script.mjs
zx --env-file .env script.mjs
— Why not use dotenv directly?
— 1) Size does matter 2) We'd like to avoid internal vaults.
— Why not load .env by default?
— 1) Explicit is better than implicit 2) Runtime itself (like bun) may provide the feature.
stdall piping #1033fullCmd and unique id #1035halt and run API in docs #1046timeout option handling for corner cases #1049killSignal setting via env vars #1054diagnostic_channel to built-ins list #1056id field and introduced end event #1057 #1058nothrown() toggleable #1066 #1029ZX_REPL_HISTORY envvar #1065file:// protocol check #1064mode option for tmpdir and tmpfile #1063_timeoutSignal override #1075ProcessPromise stage #1077 #967A tool for writing better scripts