Express author TJ said goodbye to Node. js and rushed to Go, tjnode. js
First, this is a Farewell Node translated from TJ. js. After reading this article, I have indeed suffered some impact, but I do not agree with some of the author's views, such as I think
Brief Introduction to node. js version control nvm and n, node. jsnvm
Today's topic includes two parts
1. Use nvm or n for version control under node. js2. After the node. js version is installed on nvm, restart the terminal
on the implementation of high-performance Web server optimization experts, after several exploration, after setbacks, encountered V8 and the birth of the project.The organizational structure and management model of the node. JS Projectnode. js with the jsconf EU conference and other forms of propaganda, a Silicon Valley-based start-up company noticed the project
JavaScript interpretation engine (it is responsible for executing the client's JavaScript code in the Chrome browser). Unlike other languages, node. JS has built-in libraries for handling network requests and responses, so you don't need a separate server (Apache, ngix) or other dependencies.
Although node. JS is new,
"Hello World" code. In May, in Berlin this year, Ryan presented the technology to the world. and spread so far.In short, we use a sentence to evaluate the founder of node. js. In the Web server field for many years, dedicated to solving high-performance concurrency problems. Several setbacks. Finally after encountering the V8, invented the cross-era technology of node
carefully (available libraries, resources to fix a bug or both upstream, etc.).
"Does node run on Windows?"No. If you is on Windows, you need to run a Vsan (I recommend VirtualBox) with Linux. Windows support for node was planned, but don ' t hold your breath for the next few months unless the P Ort."Can I access the DOM in node?"Excellent question! No, the
Node. js Web application framework, which is often used when building HTTP servers. Therefore, it is explained directly using Socket. IO and express as examples.
Copy codeThe Code is as follows:Var express = require ('express '), App = express (), Server = require ('http'). createServer (app), Io = require ('socket. io '). listen (server );Server. listen (3001 )
, in fact, in order to get things done, you don't need anything, you need action. in other words, you don't need a noun, you need a verb .
After understanding the core and basic ideas in this concept, I naturally understood the function programming.
One more thing to understand about node. JS is the difference between blocking IO and non-blocking IO (using
Translated from: http://blog.jobbole.com/53736/IntroducedThe popularity of JavaScript has changed so much that the way it is being used for web development today has become quite different. Just like in the browser, we can now run JavaScript on the server, spanning from the front to the back, which is unimaginable because JavaScript is like a Flash or Java applet just a few years ago. That way, embedding the Web page runs in a sandbox environment.Before you dive into
. pipe (parser ). pipe (transformer) // process the data transmitted from the previous stream. pipe (es. map (function (data, callback) {up Load (data, function (err) {callback (err) ;}) // listens to the end event of the previous stream. pipe (es. wait (function (err, body) {process. stdout. write ('done! ');}));
More Methods
You can refer to the https://github.com/jeresig/node-stream-playground, go to the sample site and click add stream to see the
index.html is in the views folder. There is no code, but I will post it as well.
my box
In this way, access localhost: 3000 in the browser after the node app. js is started. Enter the username in the database in the input file to obtain the data.
Ps: What are the advantages and disadvantages of using Node.
node. JS learns to follow the flow of this book. At the end of the 7th chapter and the end of the 10th chapter, respectively, a small project to practice practiced hand. Node. JS's Introductory Learning Plan is like this. Directory: qq:1045642972 Welcome to the book and discuss node. js.node.
executing the client's JavaScript code in the Chrome browser). Unlike other languages, node. JS has built-in libraries for handling network requests and responses, so you don't need a separate server (Apache, ngix) or other dependencies.Although node. JS is new, it quickly gets a lot of popularity. In a lot of big
tableData +row(row)- var node = [{name: "express"}, {name: "Jade"}, {name: "Handlebars"}]+table(node)- var js = [{name: 'backbone'}, {name: 'angular'}, {name: "emberJS"}]+table(js)
Output:
15. include
Include is similar to introducing JS and CSS external files. It is
: 51msoneSecond: 1000mstwoSecond: 2002msfiveSecond: 5001msProcess finished with exit code 0
The above is all the content in this article. I hope it will be helpful for you to learn how to use setTimeout and setInterval in Node. js.
Articles you may be interested in:
SetInterval and setTimeout stop Methods
Precautions for using setInterval and setTimeout in jQu
, function (res) {var html = ''; res. on ('data', function (data) {html + = data;}) res. on ('end', function () {var courseData = filterChapter (html); printCourseInfo (courseData );})}). on ('error', function () {console. log ('course data retrieval error ');})
References:Https://github.com/alsotang/node-lessons/tree/master/lesson3
Http://www.imooc.com/video/7965
Articles you may be interested in:
Full process of making crawlers
subscript without using the array subscript to manipulate all the satisfied node objects.
The performance of getElementById is better compared to using document.queryselector, so using the latter can improve performance when selecting nodes is relatively straightforward (finding nodes faster).
2. Use comparis
multiple ports3.2, open more than one process to listen to the same port, using the cluster module4, open Source component library quality is uneven, update fast, downward incompatible5, Debug inconvenient, error does not stack traceThird, suitable for node JS scene1. Restful APIThis is Nodejs ideal application scenario, can handle tens of thousands of connectio
Detailed description of Node. js Streams file read and write operations, node. jsstreams
Node. js is inherently asynchronous and event-driven, and is very suitable for processing I/O-related tasks. If you are dealing with I/O-related operations in the application, you can us
Node. js BASICS (10) use the net module and Readline module to implement Socket communication, and node. jsreadline
The socket communication of Node. js is very similar to that of C ++ and Java. Those who have learned the socket communication of these two languages can quic
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.