MyGit

8.1.0

google/zx

版本发布时间: 2024-05-14 05:05:27

google/zx最新发布版本:8.1.4(2024-07-04 18:44:34)

This new release is a big deal. It brings significant improvements in reliability and compatibility.

New features

Added usePwsh() helper to switch to PowerShell v7+ #790

import {usePwsh, useBash} from 'zx'

usePwsh()
$.shell // 'pwsh'

useBash()
$.shell // 'bash'

timeout is now configurable $ opts #796

import {$} from 'zx'

await $({ timeout: 100 })`sleep 999`

$.timeout = 1000            // Sets default timeout for all commands
$.timeoutSignal = 'SIGKILL' // Sets signal to send on timeout

await $`sleep 999`

Added --cwd option for CLI #804

zx --cwd=/some/path script.js

Introduced tmpdir and tmpfile helpers #803

import {tmpdir, tmpfile} from 'zx'

t1 = tmpdir()          // /os/based/tmp/zx-1ra1iofojgg/
t2 = tmpdir('foo')     // /os/based/tmp/zx-1ra1iofojgg/foo/

f1 = tmpfile()         // /os/based/tmp/zx-1ra1iofojgg
f2 = tmpfile('f.txt')  // /os/based/tmp/zx-1ra1iofojgg/foo.txt
f3 = tmpfile('f.txt', 'string or buffer')

相关地址:原始地址 下载(tar) 下载(zip)

查看:2024-05-14发行的版本