美文网首页
sublime运行node的方法

sublime运行node的方法

作者: guoss | 来源:发表于2017-10-22 20:08 被阅读0次

Tools -> Build System -> New Build System将以下代码复制进去

{
    "cmd": ["node", "$file"],
  "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
  "selector": "source.js",
  "shell":true,
  "encoding": "utf8",
  "windows":
    {
        "cmd": ["taskkill","/F", "/IM", "node.exe","&","node", "$file"]
    },
  "linux":
    {
        "cmd": ["killall node; node", "$file"]
    },
    "osx":
    {
    "cmd": ["killall node; node $file"]
    }
}

将文件名保存为NodeJs.sublime-build
ctrl+b就可以将打印结果输出在控制台
要想刷新再次点击ctrl+b即可

相关文章

网友评论

      本文标题:sublime运行node的方法

      本文链接:https://www.haomeiwen.com/subject/oiqnuxtx.html