Node.js course


Simply put Node.js Is running on the server side JavaScript.

Node.js Is based on Chrome JavaScript A platform established by the runtime .

Node.js Is an event driven I/O Server JavaScript environment , be based on Google of V8 engine ,V8 The engine executes Javascript Very fast , Very good performance .

Who is suitable for reading this tutorial ?

If you are a front-end programmer , You don't know how to be like PHP、Python Or Ruby And other dynamic programming languages , Then you want to create your own service , that Node.js It's a very good choice .

Node.js It runs on the server side JavaScript, If you are familiar with Javascript, Then you will easily learn Node.js.

of course , If you're a back-end programmer , Want to deploy some high-performance Services , So study Node.js It's also a very good choice .

Before learning this tutorial, you need to know

Before continuing this tutorial , You should know some basic computer programming terms . If you have studied Javascript,PHP,Java And other programming languages , It will help you understand Node.js Programming .

Version used

We can use the following command to view the current Node edition :

$ node -v

be careful : There may be differences between different versions .

first Node.js Program :Hello World!

Script mode

Here is our first Node.js Program :


console.log("Hello World");

Run instance »

Save the file , The file name is helloworld.js, And through node Command to execute :

node helloworld.js

After the program is executed , Normally , It will output... At the terminal Hello World.

Interactive mode

Open the terminal , typing node Enter command interaction mode , You can enter a code statement and execute it immediately and display the results , For example :

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

Gif Example demonstration

Next we pass Gif The figure shows you the example operation :