我想在不使用命令提示符的情况下运行这个Node.js脚本:
var spawn = require('child_process').spawn;
// Run node with the GenerateBlob.js file as an argument
var child = spawn('node', ['GenerateBlob.js']);
// Listen for any response from the child:
child.stdout.on('data', function (data) {
var result = data.toString();
});
// Listen for any errors:
child.stderr.on('data', function (data) {
console.log('There was an error: ' + data);
});
如何从另一个JavaScript程序运行此脚本(我不是指child_process),有没有其他的js程序可以让我运行这个node js脚本并获取输出,而无需使用命令提示符。