How to setup JavaScript Build in Sublime Text 2

Yes I am turning friend of Sublime Text and thought to use Sublime for JavaScript development as well. To execute JavaScript in Sublime, you need to create new Build System for JavaScript. There are two steps you need to follow,

  1. Install Node.js
  2. Create new build system for JavaScript

To install Node navigate to http://nodejs.org/ and click on download.

clip_image001

You will be navigated to download page. From here select required installer, download that and then install that. I am working on Windows machine so I selected option of Windows Installer.

After successful installation go to shell and verify successful installation. To verify it type npm on command prompt and you should get output as given below. It also verify that node is successfully added to the path.

clip_image002

Once Node is installed you need to create Build System for JavaScript. To do that navigate to

Tools -> Build Systems->New Build System

Here you need to write below code.

clip_image003

After this you can save file with any desired name. I am giving name as JavaScript-Sublime. Once you saved the file go to Tools-> Build System and you should able to see JavaScript-Sublime Build.

clip_image004

You need to select this build. After this go and write a simple JavaScript

clip_image005

And when you press Ctrl+B , you should able to get desired output as follows ,

clip_image006

So happy writing JavaScript in SublimeText. I hope you find this post useful. Thanks for reading.

3 responses to “How to setup JavaScript Build in Sublime Text 2”

  1. […] How to setup JavaScript Build in Sublime Text 2 (Dhananjay Kumar) […]

  2. I like to read your posts

Leave a comment

Create a website or blog at WordPress.com