Skip to content

8.1.1

Compare
Choose a tag to compare
@antonmedv antonmedv released this 23 May 10:51
· 85 commits to main since this release
73c829c

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