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,
- Install Node.js
- Create new build system for JavaScript
To install Node navigate to http://nodejs.org/ and click on download.
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.
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.
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.
You need to select this build. After this go and write a simple JavaScript
And when you press Ctrl+B , you should able to get desired output as follows ,
So happy writing JavaScript in SublimeText. I hope you find this post useful. Thanks for reading.
Leave a comment