First glance at Node. js_node.js

Source: Internet
Author: User
Tags install node
This article describes Node in brief. js introduction, installation, hope to just come into contact with Node. js students can help me. If you have any questions, please leave a message and learn and make progress together. 1. Node. what is js?

[1] Node is a server-side JavaScript interpreter, but if you really think JavaScript is good, you can easily win Node learning. Then you are wrong. Conclusion: I still don't know the depth, but it's not too light.

[2] The goal of Node is to help programmers build highly scalable applications and write connection code that can process tens of thousands of concurrent connections to a physical machine. Processing of high concurrency and asynchronous I/O is one of the reasons why Node is concerned by developers.

[3] Node itself runs Google V8 JavaScript engine, so the speed and performance are very good. You can see it in chrome, and Node encapsulates it and improves its ability to process binary data. Therefore, Node not only simply uses V8, but also optimizes it to make it more powerful in various environments.

[4] third-party extensions and modules play an important role in the use of Node. The following section also describes how to download npm, which is a module management tool. It is used to install various Node software packages (such as express and redis) and release software packages written for Node itself.

2. Install node. js

[1] Only download and install windows

[2] on linux:

wget http://nodejs.org/dist/v0.6.1/node-v0.10.31.tar.gz  tar zxvf node-v0.10.31.tar.gz  cd node-v0.10.31 ./configure

3. Simple cases

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


You can view "Hello World" through browser access ".

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.