Intro to Node.js
来源:互联网 发布:java 抽奖系统设计 编辑:程序博客网 时间:2024/05/15 03:19
Node.js http://node.codeschool.com/levels/1
What
Allows you to build scalable network applications using JavaScript on the server-side
Node.js is fast, because it is mostly C code.
Usage
• Websocket Server (聊天服务端)
• Fast File Upload Client
• Ad Server
• Any Real-Time Data Apps
Blocking vs NonBlocking
Blocking Code
var contents = fs.readFileSync('/etc/hosts');console.log(contents);console.log('Doing something else');NonBlocking Code
fs.readFile('/etc/hosts',function(err,contents){console.log(contents);});console.log('Doing something else');Hello World
var http = require('http');http.createServer(function(request, response) {response.writeHead(200);response.write("Hello, this is dog.");response.end();}).listen(8080);console.log('Listening on port 8080...');
Why JS
JavaScript has certain characteristics that make it very different than other dynamic languages, namely that it has no concept of threads. Its model of concurrency is completely based around events. (Ryan Dahl) 0 0
- Intro to Node.js
- How to Install Node.js
- node js porting to android
- nodemon to monitor node.js
- Node(1) Intro and refernce
- Intro to Expect
- Intro to Apache Maven
- intro to JNDI
- Intro to Makefile
- Intro to Makefile
- Intro to Bilinear Maps
- Intro.js使用方法
- Introduction to Node.js(1)
- Introduction to Node.js(2)
- How to Use Buffers in Node.js
- How to Upgrade Node.js via NPM
- node.js错误 --> node-pre-gyp install --fallback-to-build
- The quick intro to libipq
- poj1328 Radar Installation(贪心)
- OJ_1041
- OJ_1042 Coincidence
- 解决Apple Mobile Device USB Driver
- Google Java Style 中文版
- Intro to Node.js
- title_test1600392641
- title_test495514488
- title_test1445144223
- title_test-256666228
- title_test57908404
- title_test-50891941
- title_test-1390996070
- title_test780254030