Node.js

Node is an open source runtime environment for server-side applications. It allows you to run JavaScript on the server in addition to the browser. Almost all of the new and most widely used JavaScript solutions use Node in one form or another.

Installing Node.js

Download from https://nodejs.org. Install with default options. To check, type the following on the terminal

$ which node

If you see a path like the following, nodejs is installed and you can start coding:

/usr/local/bin/node

First Program

Type the following command in your non-formatting editor of choice such as sublimetext or nodepad++.

console.log(“Hello World”);

Save this file as hello.js. Type the following command to run the code:

$ node hello.js