# zx

> A tool for writing better scripts

Latest version **8.8.5** (published 2025-10-19) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install zx
pnpm add zx
yarn add zx
bun add zx
```

Provides the command `zx`.

## Health

**Score 70/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; popular repo.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 8.8.5 |
| Published | 2025-10-19 |
| First published | 2015-08-30 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 12.17.0 |
| Dependencies | 0 |
| Unpacked size | 859.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 45745 |
| Author | Anton Medvedev |
| Maintainers | medv, google-wombot |
| Keywords | bash, bin, binary, call, child, child_process, exec, execute, invoke, pipe, process, script, shell, spawn, zx |

## Links

- npm: https://www.npmjs.com/package/zx
- Repository: https://github.com/google/zx
- Homepage: https://google.github.io/zx/
- Issues: https://github.com/google/zx/issues
- npm.io page: https://npm.io/package/zx

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 8.8.5 (latest) — 2025-10-19
- 8.8.5-lite (lite) — 2025-10-19
- 8.8.1-dev.976a74a (dev) — 2025-08-18
- 6.2.6 (legacy) — 2025-07-01
- 8.8.4-lite — 2025-09-26
- 8.8.4 — 2025-09-26
- 8.8.3-lite — 2025-09-21
- 8.8.3 — 2025-09-21
- 8.8.2-lite — 2025-09-19
- 8.8.2 — 2025-09-19
- 8.8.1-lite — 2025-08-20
- 8.8.1 — 2025-08-20
- 8.8.1-lite-dev.976a74a — 2025-08-18
- 8.8.1-lite-dev.4844b49-lite — 2025-08-16
- 8.8.1-dev.4844b49 — 2025-08-16
- … 248 more at https://npm.io/package/zx/versions

## README

<h1><img src="https://google.github.io/zx/img/logo.svg" alt="Zx logo" height="32" width="28" valign="middle"> zx</h1>

```js
#!/usr/bin/env zx

await $`cat package.json | grep name`

const branch = await $`git branch --show-current`
await $`dep deploy --branch=${branch}`

await Promise.all([
  $`sleep 1; echo 1`,
  $`sleep 2; echo 2`,
  $`sleep 3; echo 3`,
])

const name = 'foo bar'
await $`mkdir /tmp/${name}`
```

Bash is great, but when it comes to writing more complex scripts,
many people prefer a more convenient programming language.
JavaScript is a perfect choice, but the Node.js standard library
requires additional hassle before using. No compromise, take the best of both. The `zx` package provides
useful cross-platform wrappers around `child_process`, escapes arguments and
gives sensible defaults.

## Install

```bash
npm install zx
```
All setup options: [zx/setup](https://google.github.io/zx/setup).
See also [**zx@lite**](https://google.github.io/zx/lite).

## Usage

* [Documentation at google.github.io/zx/](https://google.github.io/zx/)
* [Code examples](https://github.com/google/zx/tree/main/examples)

## Compatibility
* Linux, macOS, or Windows
* JavaScript Runtime:
    * Node.js >= 12.17.0
    * Bun >= 1.0.0
    * Deno 1.x, 2.x
    * GraalVM Node.js
* Some kind of [bash or PowerShell](https://google.github.io/zx/shell)
* [Both CJS or ESM](https://google.github.io/zx/setup#hybrid) modules in [JS or TS](https://google.github.io/zx/typescript)


## License

[Apache-2.0](LICENSE)

Disclaimer: _This is not an officially supported Google product._

---
_Source: https://npm.io/package/zx · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
