8/09 Nodejs Novice Tutorial study notes

Source: Internet
Author: User

1. When using node. js, we are not only implementing an application, but also implementing an entire HTTP server.
2.node.js Composition:
RCQUIRCD module: RCQUIRC instruction to load node. JS Modules
Create server: Server can listen to client requests, similar to Apache, Nginx and other HTTP server
Receive requests and response requests: The server is easy to create and the client can send HTTP requests using a browser or terminal.
The server returns the response data after it receives the request.
The 3.NPM server is equivalent to a platform that can download third-party packages and command-line programs written by others to use locally,
It also allows users to upload their own packages or command-line programs to the NPM server for others to use.
4.REPL (Interactive interpreter)
5.node.js asynchronous programming is directly manifested as callbacks. The callback function is supported by all node APIs. While reading the file, execute
Other commands, the file reads complete, returns the file contents as a callback function parameter. This way, there is no blocking or waiting when executing code
File IO operations, which improve node. JS performance, can handle a large number of concurrent requests.
Blocking is performed sequentially, and non-blocking is not required sequentially. ReadFile and Readfilesync.
6.nodejs when writing the Chinese format, it is necessary to change the Utf-8 encoding to display the characters.

7.node.js event Loop.
Each API is asynchronous and runs as a separate thread, using an asynchronous function call, and handling concurrency.

Event-driven model to handle the program.

The main loop listens for events and triggers a callback function when an event is detected.
Viewer mode.

8/09 Nodejs Novice Tutorial study notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.