Skip to content

WARNING

This is documentation for zx v7, which is no longer actively maintained.

For up-to-date documentation, see the latest version (v8).

TypeScript

Configure your project to use ES modules:

It is possible to make use of $ and other functions via explicit imports:

ts
import { $ } from 'zx'

Or import globals explicitly:

ts
import 'zx/globals'

Wrap your code in an async function and call it immediately:

ts
void async function () {
  await $`ls -la`
}()

Disclaimer: This is not an officially supported Google product.