Unleash the power of unlimited ShellJS commands... with ES6 Proxies!
Do you like ShellJS, but wish it had your
favorite commands? Skip the weird exec() calls by using shelljs-exec-proxy:
// Our goal: make a commit: `$ git commit -am "I'm updating the \"foo\" module to be more secure"`// Standard ShellJS requires the exec function, with confusing string escaping:shell.exec('git commit -am "I\'m updating the \\"foo\\" module to be more secure"');// Skip the extra string escaping with shelljs-exec-proxy!shell.git.commit('-am', `I'm updating the "foo" module to be more secure`);
Installation
Important: This is only available for Node v6+ (it requires ES6 Proxies!)
Current versions of ShellJS export the .exec() method, which if not used
carefully, could introduce command injection Vulnerabilities to your module.
Here's an insecure code snippet: