github google/zx 8.1.0

latest releases: 8.2.2, 8.2.1, 8.2.0...
6 months ago

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')
  • Support CRLF for markdown script #788
  • Added help digest for man #806
  • Added compatibility with Deno 1.x. → zx seems to be working with Deno 1.x.

Don't miss a new zx release

NewReleases is sending notifications on new releases.