zx VS shelljs

Compare zx vs shelljs and see what are their differences.

zx

A tool for writing better scripts (by google)

shelljs

:shell: Portable Unix shell commands for Node.js (by shelljs)
Our great sponsors
  • Nanos - Run Linux Software Faster and Safer than Linux with Unikernels
  • Scout APM - A developer's best friend. Try free for 14-days
  • SaaSHub - Software Alternatives and Reviews
zx shelljs
49 18
23,666 12,855
1.3% 0.6%
9.2 2.6
11 days ago 3 days ago
JavaScript JavaScript
Apache License 2.0 BSD 3-clause "New" or "Revised" License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

zx

Posts with mentions or reviews of zx. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-11-28.
  • Do you ever use node without express (or an equivalent framework? ;
    2 projects | reddit.com/r/node | 28 Nov 2021
    For scripting you should have a look at: https://github.com/google/zx It's nodejs but with some nice syntax sugar for scripting.
  • Passing a dynamic value to package.json scripts
    1 project | reddit.com/r/Angular2 | 10 Nov 2021
    Umm, for any complex script configuration you can use https://github.com/google/zx other than that it depends on your environment and how are you supplying the value to the script
  • Scripting Languages of the Future
    9 projects | news.ycombinator.com | 7 Nov 2021
    This talks a bunch about the "good run" of current scripting languages, including for example JavaScript.

    But JavaScript, as an actual scripting language, has been pretty primitive but finally starting to become a real candidate for actual scripting. There's imo crufty not very great options like shelljs[1]. But adding a tagged-template string for system(), for calling things, and a little bit of standard library has made JS a much more interesting & competent scripting language. Those efforts are being done in ZX[2].

    I like the idea of the topic, exploring it. But the author feels off in a number of places.

    > What TypeScript showed is that you could join together the idea of a flexible lightweight (and optional!) type system onto an existing programming language, and do so successfully. . . .The question then is - what if you created a programming language from the start to have this kind of support?

    Personally I just don't think languages matter very much. They're very similar, by & large. They have different tooling, packaging, somewhat different looks/feels for executing code, and their standard libraries are different. But TypeScript is popular & fast at least 90% because it is JS, because it works with JS things. Arguing that we should try to recreate TypeScript apart from JS sounds like a mind blowing waste of time. Also, Deno has good integrated TypeScript support.

    On the topic of easy parallelism, JavaScript promises are imo quite easy to stitch together & use & quite available.

    One of the main issues I see with easy-parallelism is that it's too easy: there's too many cases for uncontrolled parallelism. Throwing tarn.js or other worker-pools at problems seems all too common. But one is still left stitching together each pool/stage of work. I'd like to see SEDA[3] like architectures emerge, and perhaps get added to something like ZX standard library.

    [1] https://github.com/shelljs/shelljs

    [2] https://github.com/google/zx

    [3] https://en.wikipedia.org/wiki/Staged_event-driven_architectu...

  • Underwhelmed by Bash functions? Maybe you're using them wrong. I was.
    7 projects | reddit.com/r/programming | 31 Oct 2021
  • On multisynchronicity
    2 projects | reddit.com/r/javascript | 29 Oct 2021
    A fourth twist is to take off the functional hat and instead use an obscure corner of OOP: multiple inheritance. This isn't natively supported in JS, but some libraries use the technique in the wild (e.g. zx monkeypatches Promises with a facade over the ChildProcess interface). This differs from union types because it's two things simultaneously (rather than one OR the other), and it's up to the consumer to then await it or map over the functor if it needs to, or just access properties synchronously.
  • Automation ideas with Javascript:
    2 projects | reddit.com/r/learnjavascript | 28 Oct 2021
    I haven't tried it myself, but zx looks like a really simple way to get up and running.
  • Hacking Fish Script In Emacs
    10 projects | dev.to | 7 Oct 2021
    I think bash script is the most written script in the world, but the grammar is so old. These days, zx script which grammar like JavaScript had published by google. But we cannot use zx as a login shell, so I think we should not use it.
  • A single person answered 76k questions about SQL on StackOverflow. Averaging 22.8 answers per day, every day, for the past 8.6 years.
    3 projects | reddit.com/r/programming | 24 Sep 2021
    google made this to replace bash: https://github.com/google/zx
  • Introduction
    1 project | dev.to | 10 Sep 2021
    As a starting point, this week I explored trending projects on GitHub. I was amazed by the number of interesting projects out there, but one that especially caught my eye was google/zx, as it provides a way to write bash scripts with JavaScript
  • Wednesday Links - Edition 2021-09-01
    1 project | dev.to | 1 Sep 2021
    zx - bash in JS (1 min)🖥️ https://github.com/google/zx

shelljs

Posts with mentions or reviews of shelljs. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-11-07.
  • Scripting Languages of the Future
    9 projects | news.ycombinator.com | 7 Nov 2021
    This talks a bunch about the "good run" of current scripting languages, including for example JavaScript.

    But JavaScript, as an actual scripting language, has been pretty primitive but finally starting to become a real candidate for actual scripting. There's imo crufty not very great options like shelljs[1]. But adding a tagged-template string for system(), for calling things, and a little bit of standard library has made JS a much more interesting & competent scripting language. Those efforts are being done in ZX[2].

    I like the idea of the topic, exploring it. But the author feels off in a number of places.

    > What TypeScript showed is that you could join together the idea of a flexible lightweight (and optional!) type system onto an existing programming language, and do so successfully. . . .The question then is - what if you created a programming language from the start to have this kind of support?

    Personally I just don't think languages matter very much. They're very similar, by & large. They have different tooling, packaging, somewhat different looks/feels for executing code, and their standard libraries are different. But TypeScript is popular & fast at least 90% because it is JS, because it works with JS things. Arguing that we should try to recreate TypeScript apart from JS sounds like a mind blowing waste of time. Also, Deno has good integrated TypeScript support.

    On the topic of easy parallelism, JavaScript promises are imo quite easy to stitch together & use & quite available.

    One of the main issues I see with easy-parallelism is that it's too easy: there's too many cases for uncontrolled parallelism. Throwing tarn.js or other worker-pools at problems seems all too common. But one is still left stitching together each pool/stage of work. I'd like to see SEDA[3] like architectures emerge, and perhaps get added to something like ZX standard library.

    [1] https://github.com/shelljs/shelljs

    [2] https://github.com/google/zx

    [3] https://en.wikipedia.org/wiki/Staged_event-driven_architectu...

  • Fixing a bug in an open source project - telescope
    2 projects | dev.to | 31 Oct 2021
    Having never worked with shelljs, I spent a little bit going through their documentation and found out that exec() accepted 3 arguments for the callback, namely code, stdout and stderr. Gaining that little bit of knowledge, I went back into the file to gain an idea of what was going on.
  • Can we please share Hero Grids and Filters?
    8 projects | reddit.com/r/DotA2 | 20 Aug 2021
    i'm using visual studio code as the code editor and right now the vrf cli (using a shelljs wrapper) to decompile/export game files and assets like hero images or icons.
  • Running migrations for an Aurora Serverless cluster
    5 projects | dev.to | 13 Aug 2021
    2.The shelljs library allows us to run shell commands from nodejs. You can read more about it "here"
  • Do any of you regularly use node for shell scripting?
    6 projects | reddit.com/r/node | 4 Jul 2021
    shelljs - shell commands
  • Shell.Js Cheat Sheet
    1 project | dev.to | 13 May 2021
    Taken from the Readme.
  • Shelljs – Portable Unix shell commands for Node.js
    1 project | reddit.com/r/patient_hackernews | 9 May 2021
    1 project | reddit.com/r/hackernews | 9 May 2021
  • Portable Unix shell commands for Node.js
    1 project | reddit.com/r/javascript | 9 May 2021
    1 project | reddit.com/r/commandline | 9 May 2021

What are some alternatives?

When comparing zx and shelljs you can also consider the following projects:

Inquirer.js - A collection of common interactive command line user interfaces.

nvm - Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions

cross-env

TypeScript - TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

chalk - 🖍 Terminal string styling done right

sudo-block - Block users from running your app with root permissions

minimist - parse argument options

deno - A modern runtime for JavaScript and TypeScript.

yargs - yargs the modern, pirate-themed successor to optimist.

xonsh - :shell: Python-powered, cross-platform, Unix-gazing shell

ora - Elegant terminal spinner

get-stdin - Get stdin as a string or buffer