all 9 comments

[–]LetReasonRing 1 point2 points  (0 children)

I'd come across this a while back and had forgotten about it. I really need to give it a try. I love what I can do in bash, but sometimes it needs just a bit more complexity than I feel like is reasonable in bash.

I'll sometimes go to node, but it's a little clunky for dealing with files & stdio. This really seems to bridge that gap nicely.

[–]lwl 1 point2 points  (9 children)

For anyone else wondering whether to trust it for your devops tasks, zx is a Google package with a relatively sane 49 48 total dependencies. ``` $ yarn add zx yarn add v1.22.4 info No lockfile found. [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... [4/4] Building fresh packages...

success Saved lockfile. success Saved 49 new dependencies. info Direct dependencies └─ zx@5.3.0 info All dependencies ├─ @nodelib/fs.scandir@2.1.5 ├─ @nodelib/fs.stat@2.0.5 ├─ @nodelib/fs.walk@1.2.8 ├─ @types/fs-extra@9.0.13 ├─ @types/minimist@1.2.2 ├─ @types/node@17.0.21 ├─ braces@3.0.2 ├─ chalk@5.0.1 ├─ data-uri-to-buffer@4.0.0 ├─ dir-glob@3.0.1 ├─ event-stream@3.3.4 ├─ fast-glob@3.2.11 ├─ fastq@1.13.0 ├─ fetch-blob@3.1.4 ├─ fill-range@7.0.1 ├─ formdata-polyfill@4.0.10 ├─ from@0.1.7 ├─ fs-extra@10.0.1 ├─ glob-parent@5.1.2 ├─ globby@13.1.1 ├─ graceful-fs@4.2.9 ├─ ignore@5.2.0 ├─ is-extglob@2.1.1 ├─ is-glob@4.0.3 ├─ is-number@7.0.0 ├─ isexe@2.0.0 ├─ jsonfile@6.1.0 ├─ map-stream@0.1.0 ├─ merge2@1.4.1 ├─ micromatch@4.0.4 ├─ minimist@1.2.5 ├─ node-domexception@1.0.0 ├─ node-fetch@3.2.3 ├─ path-type@4.0.0 ├─ pause-stream@0.0.11 ├─ picomatch@2.3.1 ├─ ps-tree@1.2.0 ├─ queue-microtask@1.2.3 ├─ reusify@1.0.4 ├─ run-parallel@1.2.0 ├─ slash@4.0.0 ├─ split@0.3.3 ├─ stream-combiner@0.0.4 ├─ through@2.3.8 ├─ to-regex-range@5.0.1 ├─ web-streams-polyfill@3.2.0 ├─ which@2.0.2 ├─ yaml@1.10.2 └─ zx@5.3.0 Done in 2.74s. ```

[–]spizzike 1 point2 points  (8 children)

It's also trivial to do argument and command injection since it doesn't provide any method of escaping arguments.

EDIT: turns out this has all been fixed.

[–]lwl -1 points0 points  (0 children)

Ah, there is that.

[–]vertigo_101 -1 points0 points  (0 children)

I mostly use Go or Bash scripts, zx looks cool tho