简体   繁体   English

在没有终端的osx上启动node.js

[英]launch node.js on osx without terminal

looking to launch node.js on startup (and hidden) without having to open terminal. 希望在启动时启动(并隐藏)node.js,而无需打开终端。

currently, i have to open terminal - change directory to where my script file is with: 当前,我必须打开终端-使用以下命令将目录更改为我的脚本文件所在的目录:

 cd web/

then open my script file in node.js with 然后使用以下命令在node.js中打开我的脚本文件

 node bridge.js

this can be clunky to have to go through every time, plus if i close the terminal window, the script stops. 每次必须经过这很麻烦,而且如果我关闭终端窗口,脚本将停止。

would be ideal to have a script (applescript or other) to open this script and run continuously in the background. 最好使用脚本(applescript或其他脚本)打开此脚本并在后台连续运行。

thanks 谢谢

You might want to look into node-mac module https://github.com/coreybutler/node-mac 您可能要研究node-mac模块https://github.com/coreybutler/node-mac

I myself have never used this but from the description, it looks like that's what you need. 我本人从未使用过它,但是从描述中看来,这就是您所需要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM