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
Post a Comment