8.1.1
版本发布时间: 2024-05-23 18:51:45
google/zx最新发布版本:8.1.4(2024-07-04 18:44:34)
This release brings a pinch of sugar and minor fixes.
Features
- Introduced
$.preferLocal
option to prefernode_modules/.bin
located binaries over globally system installed ones.
#798
$.preferLocal = true
await $`c8 npm test`
await $({ preferLocal: true })`eslint .`
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 itssignal
reference.
#816
const p = $`sleep 999`
const {signal} = p
const res = fetch('https://example.com', {signal})
setTimeout(() => p.abort('reason'), 1000)