本文介绍了meteorJS从服务器调用shell命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我正在使用MeteorJS.

I'm using MeteorJS.

我想从javascript服务器端调用bash命令.使用nodeJS似乎可行: http://www.dzone.com/snippets/execute-unix-command-nodejs

I'd like to call a bash command from the javascript server side. This seems possible with nodeJS:http://www.dzone.com/snippets/execute-unix-command-nodejs

但是,我找不到与meteorJS类似的东西.我想要这样的东西:

However, I can't find something similar with meteorJS. I'd like something like that :

if(Meteor.isServer){
...

exec("myCommand");
}

推荐答案

如果您从示例中接听要求的电话并为其添加前缀

If you take the calls to require from the sample and prefix them with

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

应该可以.

这篇关于meteorJS从服务器调用shell命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-08 23:02