Skip to content

Instantly share code, notes, and snippets.

@ZeroDragon
Created August 19, 2014 16:29
Show Gist options
  • Save ZeroDragon/dde3af94047cd6d94248 to your computer and use it in GitHub Desktop.
Save ZeroDragon/dde3af94047cd6d94248 to your computer and use it in GitHub Desktop.
How to use sublime text as IDE for node and coffee

##Instalation

First we need to locate our node binary

$ which node
/usr/local/bin/node

Then in sublime text we go to Tools > Build System > New Build System ...

Replace what comes for default with this:

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

Where path is the path to where the node binary is located.

##Usage Now when you are on a .js file, just use the build hotkey (on OSX is command+B) and you'll see the results on the build screen on sublime (bottom part).

##Side notes You can play and change the binary, to coffee or nodeunit or even nodemon...

##Caveats Only works on saved files, you cannot use this on buffer.
Colors are not supported on the sublime console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment