angry_kiwi angry_kiwi - 4 months ago 16
Node.js Question

sublime build - nodejs - how to start and stop node app

So my node build is like this

{
"cmd": ["node", "$file"],
"selector" : "source.js",
"path" : "/usr/local/bin"
}


It runs, but problem is once it runs, it never stop.

Answer

You can use a reloader like node-dev for this kind of thing.

Replace node with node-dev (npm install -g node-dev) and that's it so your build file looks like this:

{
    "cmd": ["node-dev", "$file"],
    "selector" : "source.js",
    "path" : "/usr/local/bin"
}

I personally use node-dev, but you may also try node-supervisor or node-nodemon.

Comments