๐Ÿ“ฆ google / zx

A tool for writing better scripts

โ˜… 45.2k stars โ‘‚ 1.2k forks ๐Ÿ‘ 45.2k watching โš–๏ธ Apache License 2.0
bashchild-processcliexecjavascriptnodejspipeshellspawn
๐Ÿ“ฅ Clone https://github.com/google/zx.git
HTTPS git clone https://github.com/google/zx.git
SSH git clone git@github.com:google/zx.git
CLI gh repo clone google/zx
Loading files...
๐Ÿ“„ README.md

Zx logo zx

#!/usr/bin/env zx

await 

Zx logo zx

cat package.json | grep name` const branch = await

Zx logo zx

git branch --show-current` await

Zx logo zx

dep deploy --branch=${branch}` await Promise.all([

Zx logo zx

sleep 1; echo 1`,

Zx logo zx

sleep 2; echo 2`,

Zx logo zx

sleep 3; echo 3`, ]) const name = 'foo bar' await

Zx logo zx

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.


Crow Watch

Crow Watch

A computing-focused community.

Join at crow.watch/join/zx

Share great links, cool code, and new tools.


Install

npm install zx
All setup options: zx/setup. See also zx@lite.

Usage

Compatibility

  • Linux, macOS, or Windows
  • JavaScript Runtime:
  • Node.js >= 12.17.0
  • Bun >= 1.0.0
  • Deno 1.x, 2.x

See also

  • srf โ€” a tiny, dependency-free static file server for Node.js
  • fx โ€” a JSON cli tool and terminal JSON viewer

License

Apache-2.0

Disclaimer: This is not an officially supported Google product.