Skip to main content

If you want something that closely resembles the top answer but is also synchronous then this will work.

var execexecSync = require('child_process').execSync; var cmd = "echo 'hello world'"; var options = { encoding: 'utf8' }; console.log(execexecSync(cmd, options)); 

If you want something that closely resembles the top answer but is also synchronous then this will work.

var exec = require('child_process').execSync; var cmd = "echo 'hello world'"; var options = { encoding: 'utf8' }; console.log(exec(cmd, options)); 

If you want something that closely resembles the top answer but is also synchronous then this will work.

var execSync = require('child_process').execSync; var cmd = "echo 'hello world'"; var options = { encoding: 'utf8' }; console.log(execSync(cmd, options)); 
added 10 characters in body
Source Link
Cameron
  • 3k
  • 3
  • 35
  • 49

If you want something that closely resembles the top answer but is also synchronous then this will work.

var exec = require('child_process').execSync; var cmd = "echo 'hello world'"; var options = { encoding: 'utf8' }; console.log(exec(cmd, options)); 

If you want something that closely the top answer but is also synchronous then this will work.

var exec = require('child_process').execSync; var cmd = "echo 'hello world'"; var options = { encoding: 'utf8' }; console.log(exec(cmd, options)); 

If you want something that closely resembles the top answer but is also synchronous then this will work.

var exec = require('child_process').execSync; var cmd = "echo 'hello world'"; var options = { encoding: 'utf8' }; console.log(exec(cmd, options)); 
Source Link
Cameron
  • 3k
  • 3
  • 35
  • 49

If you want something that closely the top answer but is also synchronous then this will work.

var exec = require('child_process').execSync; var cmd = "echo 'hello world'"; var options = { encoding: 'utf8' }; console.log(exec(cmd, options));