Introduction to node. js [0]

Source: Internet
Author: User
Tags install node
Document directory
  • Node resources
  • Git & GitHub
  • IDE
  • Node. js [5] connect & express Introduction
  • Node. js [4] First Module
  • Node. js [3] overlooking the API (coming soon)
  • Node. js [2] Hello Node
  • Node. js [1] overlooking NPM
  • Introduction to node. js [0]

The process of learning node is wonderful, and new concepts are constantly emerging. This process also greatly expands the technical horizon and will sort out the learning experience.

What is node?

"Node. js" is the official name and is usually abbreviated for node communication.

Ryan Dahl added a set of friendly JavaScript APIs to the chrome V8 JavaScript Engine and enabled V8 to run independently on multiple platforms (V8 is regarded as a JS Virtual Machine for the moment ), in this way, JS can also write cross-platform non-browser page applications.

What is node? On GitHub, the node project readme is titled "evented I/O For V8 JavaScript", which can also be used to identify the node. Below is a short section of Node Code that implements a simple HTTP Server:

var http = require('http');http.createServer(function (req, res) {  res.writeHead(200, {'Content-Type': 'text/plain'});  res.end('Hello World\n');}).listen(1337, '127.0.0.1');console.log('Server running at http://127.0.0.1:1337/');

Node itself only provides a streamlined set of APIs that implement applications. To enable node to provide more powerful functions, Ryan draws on the experience of Perl, Python, and other languages to propose the concept of NPM (node packaged module, which is also called a module, A complete set of module release, installation, and dependency management mechanisms were created. node's subsequent success was also the result of the joint efforts of all node community members. NPM played a key role.

For more information about node, see here.

Why is node successful?

Node's initial publicity "gimmick" isSingle-thread asynchronous programming model;Single threadThis means that programming complexity is easier to control. The Node event-driven asynchronous programming model implements non-blocking Io and can write network programs with higher concurrency (such as Web Server ); it is very attractive for some specific application scenarios, such as Twitter's tweet processing queue. Other application scenarios include restful API and real-time data statistics. In general, the scenario of high concurrency and small data size is more suitable for node.

It is undeniable that the concept of node is novel, which is especially attractive to front-end engineers in the early stage, because it can implement a wide range of functions outside the browser at no cost. It can also be seen from the NPM registry, early projects were primarily used in the previous stages.

The rapid development of node has attracted more non-front-end programmers, we can see more types of modules such as relational database, no-SQL, and MVC framework.

The node development process has received strong support from the node community, which is evident from the popularity of the NPM registry site. As of, more than 17700 modules have been deployed, it is still growing (NPM will be introduced later ).

These factors have jointly promoted the popularity of node around the world in a few years.

Node resources

Now it is easy to install node, supporting multiple platforms;

API documentation: official third-party NPM

There are not many entry books and good books

  • The Chinese version of nodejs beginner, an open-source node tutorial, implements a complete and sophisticated web application, including: Server, router, Handler
  • Node for front end developers introduces native technologies and third-party modules of node in terms of network, data, and MVC.

For more resources, visit nodejs.org.

Git & GitHub

In the node world, git has become the most common source code management tool. If you want to learn more about git, refer to the open-source git tutorial progit.

GitHub is currently the most popular git remote repository hosting center. It is well-developed and popular to know about it. Currently, the top number of front-end projects on GitHub is the highest.

IDE

Sublime, notepad ++, editplus, and ultra editor. I personally think webstorm is really powerful and worth a try.

Subsequent arrangements

We hope that we can see a live node and a node that truly changes our technical life before introducing the Code. So we will first introduce NPM, Introduction + classification of all modules + introduction of popular modules; there may be:

  • Node Development Environment
  • Node API Structure Analysis
  • Develop a module
  • Connect & Express
  • Connect source code analysis
  • Express source code analysis
  • Grunt
  • ...

Think of this for the moment.

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.