Skip to content

Instantly share code, notes, and snippets.

@ryanve
Created October 7, 2016 19:18
Show Gist options
  • Select an option

  • Save ryanve/3390ea4d43542fd25edfef9ed17aca67 to your computer and use it in GitHub Desktop.

Select an option

Save ryanve/3390ea4d43542fd25edfef9ed17aca67 to your computer and use it in GitHub Desktop.
run CLI commands in node.js
var child_process = require('child_process')
function run(command) {
return child_process.execSync(command)
}
function capture(command) {
return String(run(command)).trim()
}
module.exports.run = run;
module.exports.capture = capture;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment