Skip to content

Instantly share code, notes, and snippets.

@simbo
Created April 28, 2015 09:01
Show Gist options
  • Save simbo/05ea4ade6437662087f8 to your computer and use it in GitHub Desktop.
Save simbo/05ea4ade6437662087f8 to your computer and use it in GitHub Desktop.
[node] run shell commands without using an extra package.
var childProcess = require('child_process');
var cwd = process.cwd();
var childProcessOptions = {
stdio: 'inherit',
cwd: cwd
};
childProcess.spawnSync('my-super-commandline-command', ['param1', 'param2'], childProcessOptions);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment