2012-12-08 149 views

回答

5

如果你把電話從樣品要求,並與

var sys = __meteor_bootstrap__.require('sys'); 

它應該工作前綴他們。

+5

從Meteor 0.6.0開始它就像'var sys = Npm.require('sys');'' – emgee

9

您也可以使用child_process.spawn()。

Read More about executing a UNIX command with Meteor

spawn = Npm.require('child_process').spawn; 

command = spawn('ls', ['-la']); 

command.stdout.on('data', function (data) { 
    console.log('stdout: ' + data); 
}); 

command.stderr.on('data', function (data) { 
    console.log('stderr: ' + data); 
}); 

command.on('exit', function (code) { 
    console.log('child process exited with code ' + code); 
});