That means I have to have a package.json next to my-script-file.js, and install dependencies. It also doesn't have access to $(unix-command), I'd have to run exec() in my script file, and then worry about sanitizing those commands.
zx has a bunch of defaults and modules out of the box, so it conveniently lets me make my scripts portable and easier to write without having to worry about a bunch of the boilerplate and legwork I would need if I did node ./my-script-file.js. It's the same argument I guess of using any library over writing it from scratch yourself instead. Convenience. It also comes with the same drawbacks of using libraries, mostly trust issues.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Sorry I don't get it, but how is that different from executing
node ./my-script-file.js
?That means I have to have a
package.json
next tomy-script-file.js
, and install dependencies. It also doesn't have access to$(unix-command)
, I'd have to runexec()
in my script file, and then worry about sanitizing those commands.zx
has a bunch of defaults and modules out of the box, so it conveniently lets me make my scripts portable and easier to write without having to worry about a bunch of the boilerplate and legwork I would need if I didnode ./my-script-file.js
. It's the same argument I guess of using any library over writing it from scratch yourself instead. Convenience. It also comes with the same drawbacks of using libraries, mostly trust issues.