github google/zx 8.1.1

latest releases: 8.1.3, 8.1.2
one month ago

This release brings a pinch of sugar and minor fixes.

Features

  • Introduced $.preferLocal option to prefer node_modules/.bin located binaries over globally system installed ones.

    #798
$.preferLocal = true

await $`c8 npm test`

await $({ preferLocal: true })`eslint .`
  • Added some formatter shortcuts for ProcessPromise:

    #764, #811, #815
const p = $`echo 'foo\nbar'`

await p.text()        // foo\n\bar\n
await p.text('hex')   //  666f6f0a0861720a
await p.buffer()      //  Buffer.from('foo\n\bar\n')
await p.lines()       // ['foo', 'bar']
await $`echo '{"foo": "bar"}'`.json() // {foo: 'bar'}
  • ProcessPromise now exposes its signal reference.

    #816
const p = $`sleep 999`
const {signal} = p

const res = fetch('https://example.com', {signal})

setTimeout(() => p.abort('reason'), 1000)

Fixes

  • CLI flag --quiet is mapped to $.quiet option. #813
  • Module conditional exports are properly sorted now. #812
  • A newline character is appended to the output of ProcessPromise if it's missing. #810

Don't miss a new zx release

NewReleases is sending notifications on new releases.