Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Node.js那些事儿
Search
Allen Liu
May 27, 2012
Programming
2
1.6k
Node.js那些事儿
课题分享
Allen Liu
May 27, 2012
Tweet
Share
More Decks by Allen Liu
See All by Allen Liu
字符集科普知识
liuxd
1
70
Nginx基础知识
liuxd
5
330
vagrant介绍
liuxd
2
290
PHP5.3、PHP5.4的特性介绍与深度挖掘
liuxd
3
300
Other Decks in Programming
See All in Programming
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
160
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
4
250
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
0
910
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
220
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
1.1k
フロントエンド開発の勘所 -複数事業を経験して見えた判断軸の違い-
heimusu
7
2.8k
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
960
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
5.9k
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
380
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.5k
「ブロックテーマでは再現できない」は本当か?
inc2734
0
340
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
A Soul's Torment
seathinner
5
2.2k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
400
The Language of Interfaces
destraynor
162
26k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
150
Information Architects: The Missing Link in Design Systems
soysaucechin
0
770
Optimising Largest Contentful Paint
csswizardry
37
3.6k
Everyday Curiosity
cassininazir
0
130
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
430
How to Think Like a Performance Engineer
csswizardry
28
2.4k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
88
Transcript
Node.js 那些事儿 作者:刘喜东
2 Content What Why How Where
Who
3 Content What Why How Where
Who
4 是什么? ➢ 学名: Node.js ➢ 辟谣:核心由 C/C++ 编写 ➢
本质:一个 JavaScript 虚拟机 ➢ 托管: https://github.com/joyent/node ➢ 概括: evented I/O for v8 javascript
5 Content What Why How Where
Who
6 Apache+mod_php
7 Node.js
8 Node.js VS Apache+mod_php ➢ 独立完成 VS 细化分工 ➢ 面向事件编程
VS 面向对象编程 ➢ 英雄主义 VS 人海战术 ➢ 劳模 VS 普通青年
9 Node.js 的优点 学习成本低 内存占用少 CPU 利用率高
10 Content What Why How Where
Who
11 离了模块就活不了 ➢ npm ➢ CommonJS ➢ 核心模块概览
npm ➢ Node Package Manager ➢ pear 、 gem 、
apt ➢ curl http://npmjs.org/install.sh | sudo sh
CommonJS ➢ 它是一套 API 。 ➢ 它要为 Web 服务器 ,
桌面和命令行应用创 建一个完整的 JavaScript 生态系统,不 仅仅只为浏览器。 ➢ 它定义了一组标准和规范,如模块、包、 文件系统等。
核心模块 ➢ http/https ➢ url ➢ os ➢ fs ➢
assert ➢ ... ...
代码示例 ➢ 功能:根据坐标获取小区列表的 API 。 ➢ 方式: POST ➢ 返回:
JSON ➢ 测试: ab -c 100 -n 1000 ➢ 网址: https://github.com/liuxd/MyNodeJS
Apache+mod_php
Node.js
18 Content What Why How Where
Who
19 用武之地 ➢ IO 频繁 ➢ CPU 利用率低 ➢ 内存导致并发瓶颈
20 应用场景 ➢ 聊天系统 ➢ 投票 ➢ 点击量统计 ➢ 秒杀
➢ 业务耦合较低的 api ➢ ... ...
21 Content What Why How Where
Who
22 谁在用? ➢ Instagram—— 基于 Node.js 开发了 node2dm ➢ LinkedIn——
移动应用业务 ➢ Github——NodeLoad, 存档下载服务器 ➢ —— 淘宝 用 Node.js 实现 MyFOX ➢ 微软、雅虎、 ebay
23 By the way ➢ NAE——Node App Engine ➢ http://registry.npmjs.vitecho.com
➢ npm config set registry “XXOO” ➢ PHP 版的 Node.js——React
Thank you very much.