Shescape
A simple shell escape package for JavaScript. Use it to escape user-controlled
inputs to shell commands to prevent shell injection.
Example
Please read the full documentation for more information.
Below is a basic example of how to use Shescape. In this example spawn
is
used to invoke a shell command and shescape.escapeAll
is used to escape any
dangerous character in any of the arguments specified by the array
userInput
.
const cp = require("child_process");
const shescape = require("shescape");
cp.spawn("command", shescape.escapeAll(userInput), options);