Node. js Lesson 1 (Introduction)

Source: Internet
Author: User

Worker 1. What is Node. js? Node. javascript is not an independent language. It is different from PHP, java, and ,. net is a different development language and platform. It is not the javaScript framework jquery, nor is it the library ExtJs of the browser. It cannot be compared with ExtJs. Node. js is a development platform that allows JavaScript to run on the server. 2. what can Node. js do? JavaScript is generated by the client, and Node. js is generated by the network. Web Socket server TCP/UDP Socket Application command line tool interactive terminal program for websites with complex logic based on social network Web applications... node. js generation factors: V8 javaScript's blank events on the server drive CommonJs standardization 3. asynchronous I/O and event-driven Node. the biggest feature of js is the asynchronous I/O and event-driven architecture design. For high-concurrency solutions, the traditional architecture is a multi-threaded model that provides a system thread for each business logic, the time overhead of synchronous I/O calls is compensated by system thread switching. The single-threaded model used by Node. js maintains an event queue during execution, and the program waits for the next event in a time loop during execution. Normal: res = db. query ("select * from user") res. output (); Node. js: res = db. query ("select * from user", function (res) {res. the output ();}) program is automatically executed. 4. Google Chrome's engine for the browser engine revolution is V8. Node. js is referenced by the engine by V8. So it's fast. Why is ExtJs so fast in Chrome. 5. Deploy the node. js environment. Official Node. js: http:/nodejs.org to download the installation package. After installation. Open the dos window of cmd and run node console. log ("success ")

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.