像 Ruby 'exec' 但对于 Node.js? [英] Like Ruby 'exec' but for Node.js?

查看:41
本文介绍了像 Ruby 'exec' 但对于 Node.js?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找类似于 Ruby 内核exec"的命令,但适用于 Node.js.有什么想法吗?

I'm looking for a command like Ruby's kernel 'exec' but for Node.js. Any thoughts?

推荐答案

我接受了 @phs 的建议并构建了一个原生的 Node.js 模块.可以找到一些细节 此处.Github 源这里.

I took the advice of @phs and built a native Node.js module. A bit of details can be found here. Github source here.

你可以这样使用它:

npm install kexec

var kexec = require('kexec');
kexec("your_process with args here");

这篇关于像 Ruby 'exec' 但对于 Node.js?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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