node. js

Source: Internet
Author: User

node. JS is a platform built on the chrome JavaScript runtime to easily build fast, easy-to-scale Web applications · node. js with event-driven, non-blocking I/O models become lightweight and efficient, ideal for data-intensive real-time applications running on distributed devices

[2] node. JS is a platform that can quickly build Web services and applications. The platform was built based on the Chrome's JavaScript runtime, which means it was actually encapsulated by the Google V8 engine (applied to Google Chrome). The V8 engine executes JavaScript very fast and performs very well. Node optimizes some of the special use cases, providing an alternative API that allows V8 to run better in a non-browser environment. [3] For example, in a server environment, the processing of binary data is usually necessary, but JavaScript support for this is not enough, therefore, V8. Node adds the buffer class for easy and efficient processing of binary data. As a result, node does not simply use the V8, but also optimizes it to give it more power in every environment.

What are the features of node. JS 1: Asynchronous IO Asynchronous is not synchronous, using asynchronous can be higher allocation of resources in node most operations are asynchronous way to call, the node team to build a lot of asynchronous IO at the bottom of the API, from the file read to the network request, etc.   The implication is that in node we can do parallel IO operations naturally from the language level, with each call not having to wait for such as to read two files, the synchronization will be (Operation 1+ operation 2) Total time and async is Max (Operation 1+ Action 2) 2: Event and callback function  Node chose Javascript,javascript not only to assume more responsibilities in the previous segment, but also to assume responsibility at the back end, which introduced a broad and mature time in the previous browser to the backend, with asynchronous IO exposing the point of time to the business logic Case: node can create a server on the backend to handle requests sent by the user in contrast, events are common events that are programmed in a lightweight, loosely coupled way, regardless of whether the front or back end is the focus of the time, but how cooperation will be an issue in the context of multiple cross-field tasks.

The event callback in node is a feature of node, and he solves the problem that the callback function is the best way to accept the return data of an asynchronous call, (many older programmers can't accept it), that the code is written in a sequence that does not have much to do with the order of execution (which leads to a process control, not a good reading,  So it is recommended to try to write the normal code) 3: Single-threaded processing mode node maintains JavaScript in the browser single-threaded features, in node can not enjoy any state, so do not worry about synchronization problems but unavoidable he also has his own shortcomings can not take advantage of multi-core CPU Generate error will all quit Program 4: Cross platform can be used under each platform

Why JavaScript JavaScript since the birth of the location has been very awkward, before basically no one to regard it as a programming language (not many programmers will spend too much time to learn to JS) just as a web small script, more applications are data validation ( In fact, this is the first to release the use of JS, but with the advent of the web2.0 era, JS has been in the page to play out more features, such as to make your Web page more animated sense In the web2.0 era, more of the former framework was developed by developers, initially only to solve the problem of incompatibility between browsers, such as jquery, but as more user needs in the previous break, JS from the previous application appeared in the development of application level above, tools (browser compatibility)-- Components (function Modules)--Framework (functional module organization)--Application (Application module organization)

node. js

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.