2012-12-08 12 views

Odpowiedz

5

Zażycie połączenia wymagać od próbki i poprzedzić je

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

powinno działać.

+5

Od Meteor 0.6.0 byłoby coś 'var sys = Npm.require ('sys');' – emgee

9

Można również użyć 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); 
}); 
Powiązane problemy