8.1.3
版本发布时间: 2024-06-20 04:53:57
google/zx最新发布版本:8.1.4(2024-07-04 18:44:34)
Nothing special today. We just keep improving the implementation.
Features
import {$} from 'zx'
-
zx/cli
exports its inners to allow more advanced usage. Imagine, your own CLI tool that useszx
as a base:
#828
#!/usr/bin/env node
import './index.mjs'
import {main} from 'zx/cli'
main()
const getFixedSizeArray = (size) => {
const arr = []
return new Proxy(arr, {
get: (target, prop) =>
prop === 'push' && arr.length >= size
? () => {}
: target[prop],
})
}
const store = {
stdout: getFixedSizeArray(1),
stderr: getFixedSizeArray(1),
stdall: getFixedSizeArray(0),
}
const p = await $({ store })`echo foo`
p.stdout.trim() // 'foo'
p.toString() // ''
- Introduced sync methods for
ps
:
#840
import { ps } from 'zx'
const list1 = await ps()
const list2 = await tree()
// new methods
const list3 = ps.sync()
const list4 = tree.sync()
Chore
-
$.log
acceptskind: 'custom'
#834 - Describe
$.verbose
and$.quiet
modes internals #835 - Mention
quotePowerShell
in docs #851 - Finally fixed the annoying flaky problem of the process end detection in Bun #839, coderef
- Suppress
async_hooks.createHook
warning on bun #848 - Remove node-abort-controller in favor of built-in node-fetch polyfill #842
- Add missing global types #853