Lets build our first Hello Node app. To build a simple Hello Node app, you only need a text editor and Node REPL. Just follow these easy steps.
- Create a new folder nodeapp in your systen
- Open any Text Editor.
- Create a new file.
- Save the new file as test.js in nodeapp folder.
- Open Terminal
- Change directory to nodeapp
For example, lets say our nodeapp folder is in our desktop and test.js file is there, open terminal and start typing these steps one by one.
Node JS IDE
There are so many IDE available for Node JS. Any developer can choose IDE based on his/her personal preference. Here is a list of Top IDes for Node JS.
|VS Code||Windows / Mac / Linux||Open Source|
|WebStorm||Windows / Mac / Linux||Paid|
|VIM||Windows / Mac / Linux||Open Source|
VS Code is one of the preferred IDE for Node JS. It is open source and available for all platforms. VS Code was developed by Microsoft.
Reason to choose VS Code for Node JS
- Open Source
- Available for windows / Mac and Linux.
- Light weight.
- Comes with IntelliSence for Node JS.
- Extensions available.
- Build-in GIT.
- Build-in Console
VS Code is made by Electron, a framework used to deploy Node JS Apps for desktop. Electron use HTML and CSS for layout and Node JS for functionality.
Run Hello Node in VS Code
Lets run our last appplication , i.e. nodeapp saved on desktop on VS Code. Open VS Code and follow these easy steps.
- Open VS Code
- Press Ctrl + O or Cmd + O in Mac.
- Choose folder
- Open Terminal from View or type ^` in mac or Ctrl + ` in windows/linux.
- Type node testapp.js in VS Code terminal
VS Code Terminal can both run the code and debugs.