Latest web development tutorials

Node.js tutorial

nodejs

Simply put Node.js is run server-side JavaScript.

Node.js is based on the establishment of a Chrome JavaScript run-time platform.

Node.js is an event-driven I / O server-side JavaScript environment, based on Google's V8 engine, the V8 Javascript execution speed is very fast, very good performance.


Who should take this tutorial?

If you are a front-end programmer, you do not know like PHP, Python or Ruby and other dynamic programming language, and you want to create your own service, Node.js is a very good choice.

Node.js JavaScript is running on the server side, if you are familiar with Javascript, then you will be very easy to learn Node.js.

Of course, if you are a back-end programmer, I want to deploy some of the high-performance service, then learn Node.js is a very good choice.


Before this tutorial you need to know

Before proceeding with the tutorial, you should understand some basic computer programming terminology. If you've ever tried Javascript, PHP, Java and other programming languages, it will help you quickly understand Node.js programming.


The version used

We can use the following command to view the current version of Node:

$ node -v
v4.4.3

Note: There may be differences between different versions.


First Node.js program: Hello World!

Script mode

Here is our first Node.js program:

Examples

console.log ( "Hello World");

Running instance »

Save the file named helloworld.js, and executed by node command:

node helloworld.js

After program execution, normal, the terminal will output Hello World.

Interactive mode

Open a terminal and type the command node enters interactive mode, and displays the results after the execution can immediately enter a code statement, for example:

$ node
> console.log('Hello World!');
Hello World!

Gif examples demonstrate

Next we show you examples by Gif Pictured actions: