meteorJS 从服务器调用一个 shell 命令 [英] meteorJS call a shell command from the server

查看:15
本文介绍了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");
}

推荐答案

如果您从示例中调用 require 并使用前缀

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

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

它应该可以工作.

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆