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.

Advertisements

3 thoughts on “How to setup JavaScript Build in Sublime Text 2

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s