Bash is great, but when it comes to writing more complex scripts, many people prefer a more convenient programming language. JavaScript is a perfect choice, but the Node.js standard library requires additional hassle before using. The zx package provides useful wrappers around child_process
, escapes arguments and gives sensible defaults.
Related to https://github.com/google/zx
docker run -it --rm ealen/zx
# From volume
docker run -it --rm -v $PWD:/scripts zx /scripts/xxx.mjs
/scripts zx xxx.mjs
# From VI
docker run -it --rm -v $PWD:/scripts
/scripts vi xxx.mjs
/scripts zx xxx.mjs