Bash is great, but when it comes to writing scripts, people usually choose a more convenient programming language. JavaScript is a perfect choice, but the standard Node.js library requires additional hassle before use. The zx package provides useful wrappers around child_process, escapes arguments, and gives sensible defaults. Write your scripts in a file with .mjs extension in order to be able to use await on top level. If you prefer the .js extension, wrap your scripts in something like void async function.
Features
- All functions ($, cd, fetch, etc) are available straight away without any imports
- Packages are available without importing inside scripts
- If only the exitCode is needed, you can use the next code instead
- Write your scripts in a file with .mjs extension
- The zx also provides a few experimental functions
- The zx package provides useful wrappers around child_process
License
Apache License V2.0Follow zx
Other Useful Business Software
Catch Bugs Before Your Customers Do
Move from alert to fix before users notice. AppSignal monitors errors, performance bottlenecks, host health, and uptime—all from one dashboard. Instant notifications on deployments, anomaly triggers for memory spikes or error surges, and seamless log management. Works out of the box with Rails, Django, Express, Phoenix, Next.js, and dozens more. Starts at $23/month with no hidden fees.
Rate This Project
Login To Rate This Project
User Reviews
Be the first to post a review of zx!