node-shell-escape
node-shell-escape copied to clipboard
Empty string argument should be quoted
Currently an empty string argument becomes an empty string, and is thus ignored by the shell:
$ node -e "let esc = require('shell-escape'); console.log('|' + esc(['']) + '|')"
||
Instead an empty string should become as '' I think.
If I may suggest this, it is often better to try to use something like cross-spawn which accepts an array of arguments and knows how to target the current platform (see #9). You will have a more portable and safe program if you use that approach.