3 ms·
Honestly the more appealing aspect than the "await $`cmd`" syntax is that it imports a bunch of handy libs by default. For some reason there's just something t
by rattray 5y ago
Honestly the more appealing aspect than the "await $`cmd`" syntax is that it imports a bunch of handy libs by default.
For some reason there's just something that rubs me the wrong way about having a bunch of requires at the top of a bash script (or cluttering my package.json with handy tools I use once in a script). But you're gonna want things like (promisified) fs, os, chalk, readline, node-fetch, etc quite a lot of the time.
Definitely wish they'd included shelljs though; almost strange not to.
I hope they add (or already have) syntax highlighting as .mjs without the file extension (just the shebang) for GitHub, VSCode, etc.
- tln 5y agoCurrently, your scripts have to use the .mjs syntax to work because zx uses import() to actually execute the script.