Like bash scripts, but in JavaScript
Gushio* is built on top of battle-tested libraries like commander and
shelljs and allows you to write a multiplatform shell script in a single
JavaScript file without having to worry about package.json
and dependencies installation.
* Gushio is pronounced like the italian word "guscio" (IPA: /'guʃʃo/) which means "shell".
You can find some examples of Gushio scripts here. You can even try to run them directly with:
gushio https://github.com/Forge-Srl/gushio/raw/main/examples/<SCRIPT_FILENAME>
Install with npm:
npm install -g gushio
The documentation of Gushio is available here.
We don't claim that Gushio is the perfect solution for everyone. However, we believe that in some circumstances you should give it a try:
- if you need your script to run on different platforms (Windows, Linux, macOS);
- if you want to write automation scripts for a JavaScript/TypeScript project;
- if you want your script to be more easily maintainable than a Bash/PowerShell script;
- if you would like to use functionalities from NPM libraries in your script;
There are two main differences between zx
and gushio
:
- Both
zx
andgushio
use ESM, butgushio
allows the scripts to be written in both ESM and CJS. zx
doesn't provide a way to use NPM libraries in the scripts.
Apart from that, there are some other minor differences in the functionalities provided out of the box. For example,
zx
uses chalk
and globby
while
gushio
uses ansi-colors
and glob
.
We think they are both fantastic tools, and we encourage folks to use zx
instead of gushio
if it makes sense for
their use-case.
See the LICENSE file for license rights and limitations (MIT).