我正在从终端 (mac) 运行带有 node.js 的脚本,当我更改脚本时,我希望能够重新运行它,而不必关闭并重新打开终端,我是 mac 新手,不知道如何执行此操作?
Thanks
How are you starting Node? You should never have to close your terminal window. At the very least, you should be able to type ctrlC to stop it, then press the up arrow to bring the node command back from your command history, or type the command !!
, which means “the last command line I ran”, and hit the return key.
-
Or, use node-dev。当文件在与节点脚本相同的目录中发生更改时,它会自动重新启动节点。你可以安装它npm。然后,运行node-dev
代替node
:
node-dev script.js
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)