Create a Javascript console in Sublime

STEP 1:

Download Node.js and run the install
https://nodejs.org/en/

STEP 2:

In Sublime, go to Tools > Build System > New Build System and paste the following code:

Make sure this is the only code you see.

STEP 3:

Save the file as “node.sublime-build” in the default “user” folder, which should already be populated for you.

If you receive a [Errno 2] error when trying to use the console, then you’ll need to change “node” in the code above to the path where node is located. To do this, type ‘which node’ in terminal, copy the url path, and paste over “node” in your code.

How to use the console:

Load your Javascript file into Sublime and go to Tools > Build System in the top bar and select “node”. This is the build system that you just created.

Now just click command + b whenever you want to build (run) the JS file!

(Visited 33 times, 1 visits today)