Since I’m more comfortable in Python than JS, when bash gets hairy I tend to switch to Python and use the subprocess module to invoke commands.
subprocess
Is there a standard way to invoke shell commands from within “normal” Javascript (e.g. whatever node.js uses)?
There’s exec and spawn which can be used from JS/node to execute a shell command. Alternatively, you can run JS from the shell with the -e option in node.
Since I’m more comfortable in Python than JS, when bash gets hairy I tend to switch to Python and use the
subprocessmodule to invoke commands.Is there a standard way to invoke shell commands from within “normal” Javascript (e.g. whatever node.js uses)?
There’s exec and spawn which can be used from JS/node to execute a shell command. Alternatively, you can run JS from the shell with the -e option in node.