javascript - Node.js - Call a system command or external command -


i've issue node.js. python, if wanted execute external command, used this:

import subprocess subprocess.call("bower init", shell=true) 

i've read child_process.exec , spawn in node.js can't want. , what's want?

i want execute external command (like bower init) , see output in real time , interact bower itself. thing can receive final output don't allow me interact program.

regards

edit: saw this question answer doesn't work here. want send input when external program needs it.

how this?

var childprocess = require('child_process');  var child = childprocess.spawn('bower', ['init'], {   env: process.env,   stdio: 'inherit' });  child.on('close', function(code) {   process.exit(code); }); 

seemed work me


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -