google/zx
google/zx
Activity
Last release
Open issues
Open PRs
License
release notes
release notes
A tool for writing better scripts
release notes
Published 6/4/2025
PatchSafe upgraderelease notes
Published 6/4/2025
PatchSafe upgradeMinor feature polish.
const cwd = tempdir()
const delimiter = '\0'
const p1 = $({
cwd
})`touch foo bar baz; find ./ -type f -print0 -maxdepth 1`
(await p1.lines(delimiter)).sort() // ['./bar', './baz', './foo']
// or via options
const lines = []
const p2 = $({
delimiter,
cwd,
})`find ./ -type f -print0 -maxdepth 1`
for await (const line of p2) {
lines.push(line)
}
lines.sort() // ['./bar', './baz', './foo']
Minor feature polish.
const cwd = tempdir()
const delimiter = '\0'
const p1 = $({
cwd
})`touch foo bar baz; find ./ -type f -print0 -maxdepth 1`
(await p1.lines(delimiter)).sort() // ['./bar', './baz', './foo']
// or via options
const lines = []
const p2 = $({
delimiter,
cwd,
})`find ./ -type f -print0 -maxdepth 1`
for await (const line of p2) {
lines.push(line)
}
lines.sort() // ['./bar', './baz', './foo']