Skip to content

8.5.5 — PVC Wizard

Latest
Compare
Choose a tag to compare
@antonmedv antonmedv released this 04 Jun 09:12
· 9 commits to main since this release

Minor feature polish.

  • ProcessPromise and ProcessOutput lines() getters now accept a custom delimiter #1220 #1218
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']