Migration from v7 to v8
v8.0.0 release brought many features, improvements and fixes, but also has introduced a few breaking changes.
$.verboseis set tofalseby default, but errors are still printed tostderr. Set$.quiet = trueto suppress any output.
$.verbose = true // everything works like in v7
$.quiet = true // to completely turn off logging
sshAPI was dropped. Install webpod package instead.
// import {ssh} from 'zx' ↓
import {ssh} from 'webpod'
const remote = ssh('user@host')
await remote`echo foo`
- zx is not looking for
PowerShellanymore, on Windows by default. If you still need it, use theusePowerShellhelper to enable:
import { usePowerShell, useBash } from 'zx'
usePowerShell() // to enable powershell
useBash() // switch to bash, the default
To look for modern PowerShell v7+, invoke usePwsh() helper instead:
import { usePwsh } from 'zx'
usePwsh()
- Process cwd synchronization between
$invocations is now disabled by default. This functionality is provided via an async hook and can now be controlled directly.
import { syncProcessCwd } from 'zx'
syncProcessCwd() // restores legacy v7 behavior