Created
October 7, 2016 19:18
-
-
Save ryanve/3390ea4d43542fd25edfef9ed17aca67 to your computer and use it in GitHub Desktop.
run CLI commands in node.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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