- Open the Tools>Build System menu and select “new build system”
- Name it Node, and a new file called node.sublime-build will be created.
- Add the following data to it and save:
- Restart Sublime
- Select Node as the build system for your file and hit cmd + b to build from Sublime!
"cmd": ["node", "$file", "$file_base_name"],
Here’s an example JS file to run:
console.log("Hi, I'm your program's output.");
For more Sublime goodies, see:
Notes from my talk at Hack Reactor
Strip trailing whitespace every time you save a file in Sublime Text