github google/zx 8.1.7

latest release: 8.1.8
2 days ago

Step by step on the road to improvements

Fixes

Finally, we've fixed the issue with piped process rejection #640 #899:

const p1 = $`exit 1`.pipe($`echo hello`)
try {
  await p1
} catch (e) {
  assert.equal(e.exitCode, 1)
}

const p2 = await $({ nothrow: true })`echo hello && exit 1`.pipe($`cat`)
assert.equal(p2.exitCode, 0)
assert.equal(p2.stdout.trim(), 'hello')

Enhancements

Added cmd display to ProcessPromise #891:

const foo = 'bar'
const p = $`echo ${foo}`

p.cmd // 'echo bar'

and duration field to ProcessOutput #892:

const p = $`sleep 1`.nothrow()
const o = await p

o.duration // ~1000 (in ms)

Enabled zurk-like pipe string literals #900:

const p = await $`echo foo`.pipe`cat`
p.stdout.trim() // 'foo'

Don't miss a new zx release

NewReleases is sending notifications on new releases.