How to get the original command line arguments in a node.js application, given this command:
node forwardwithssh.js echo "hello arguments"
process.argv will be [ "node", "/path/to/forwardwith.js", "echo", "hello arguments" ]
And there is no way to restore the original echo "hello arguments" from this (that is, join(" " will not return quotes). I want the entire original source line after the script name.
what i want is easy to get in bash scripts with "$*" , is there an equivalent way to get this in node.js?
Note. In particular, the goal is to get a command to execute elsewhere (for example, via ssh)
Benja source share