webpack-shell-plugin
webpack-shell-plugin copied to clipboard
suggestion on running a generic shell command
To run a generic shell command, do this:
const cp = require('child_process');
const k = cp.spawn('bash');
k.stdin.write('\n');
k.stdin.write('any command you would ever want in any format');
k.stdin.end();
the above will change your life when writing library code where the user gives you an arbitrary command to run.