node.jså ¥éãã¾ããï¼ var rl = require('readline'); var cp = require('child_process'); var i = rl.createInterface(process.stdin, process.stdout, null); i.setPrompt('%node% '); i.on('line', function (cmd) { cp.exec(cmd, function (error, stdout, stderr) { if (stdout.length > 0) console.log(stdout); if (stderr.length > 0) console.log(stderr); i.prompt(); }); }); i.on('close', function() { process.exit(0); }
{{#tags}}- {{label}}
{{/tags}}