forked from claudeck/ppt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnodejs.html
369 lines (334 loc) · 12.6 KB
/
nodejs.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Introduction to Node.js</title>
<meta name="description" content="How to study Javascript">
<meta name="author" content="Claude Jiang">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="css/reveal.min.css">
<link rel="stylesheet" href="css/theme/default.css" id="theme">
<!-- For syntax highlighting -->
<!--
<link rel="stylesheet" href="lib/css/zenburn.css">
<link rel="stylesheet" href="lib/css/github.css">
-->
<link rel="stylesheet" href="lib/css/xcode.css">
<!-- If the query includes 'print-pdf', use the PDF print sheet -->
<script>
document.write( '<link rel="stylesheet" href="css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<h1>Introduction to Node.js</h1>
<p>
<small>Speaker : <a href="http://www.claudejiang.com">Claude Jiang</a></small>
</p>
</section>
<section>
<h2>Outlines</h2>
<ul>
<li>Who are using Node.js</li>
<li>History</li>
<li>Hello World</li>
<li>Tools</li>
</ul>
</section>
<section>
<section>
<h2>Who are using Node.js</h2>
<ul>
<li>Trello</li>
<li>Linkedin Mobile</li>
<li>c9.io</li>
<li>Browserling</li>
<li>国内Node知名项目</li>
</ul>
</section>
<section>
<h2>Trello</h2>
<a href="http://blog.fogcreek.com/the-trello-tech-stack/">
<img width="600" height="500" src="img/trello-freehand.jpg" alt="Unicorn">
</a>
</section>
<section>
<h2>Linkedin Mobile</h2>
<a href="http://engineering.linkedin.com/tags/nodejs">
<img width="600" height="500" src="img/linkedin.png" alt="Unicorn">
</a>
<aside class="notes">
http://www.slideshare.net/phegaro/linkedin-mobile-how-do-we-do-it
</aside>
</section>
<section>
<h2>c9.io</h2>
<a href="http://engineering.linkedin.com/tags/nodejs">
<img width="600" height="500" src="img/c9.png" alt="Unicorn">
</a>
<aside class="notes">
http://www.slideshare.net/fjakobs/kick-ass-code-editing-and-end-to-end-javascript-debugging?from_search=2
</aside>
</section>
<section>
<h2>Browserling</h2>
<a href="https://browserling.com/">
<img width="600" height="500" src="img/browserling.png" alt="Unicorn">
</a>
<aside class="notes">
http://www.slideshare.net/fjakobs/kick-ass-code-editing-and-end-to-end-javascript-debugging?from_search=2
</aside>
</section>
<section>
<h2>国内NodeJS知名项目</h2>
<ul>
<li>淘宝指数</li>
<li>花瓣网</li>
<li>Pomelo</li>
<li>node-webkit</li>
</ul>
</section>
</section>
<section>
<section>
<h2>History</h2>
<ul>
<li>Ryan Dahl - Node.js</li>
<li>Joyent - PaaS - Cloud Computing</li>
<li>Isaac Z. Schlueter - NPM - </li>
<li>Express & TJ Holowaychuk</li>
<li>StrongLoop</li>
</ul>
</section>
<section>
<h2>Ryan Dahl</h2>
<ul>
<li>Node.JS之父</li>
<li>2009年开发node.js</li>
<li>2012年将node.js的管理权转给Isaac</li>
</ul>
<a href="#">
<img width="500" height="300" src="img/dahl-node.jpg" alt="Unicorn">
</a>
</section>
<section>
<h2>Joyent</h2>
<ul>
<li>2010年底Ryan Dahl加入Joyent</li>
<li>Cloud Computing</li>
<li>PaaS</li>
</ul>
</section>
<section>
<h2>Isaac Z. Schlueter</h2>
<ul>
<li>Node Package Manager(NPM)主要开发者</li>
<li>0.6.3以后,NPM成为node安装包自带的工具</li>
<li>Node.JS现任领导者</li>
</ul>
<a href="#">
<img width="300" height="300" src="img/isaac.jpeg" alt="Unicorn">
</a>
</section>
<section>
<h2>TJ Holowaychuk</h2>
<a href="#">
<img width="300" height="300" src="img/tj.jpeg" alt="Unicorn">
</a>
<a href="#">
<img width="500" height="500" src="img/tj.png" alt="Unicorn">
</a>
</section>
<section>
<h2>StrongLoop</h2>
<a href="http://strongloop.com/community/nodejs-infographic">
<img width="600" height="500" src="img/strongloop.png" alt="Unicorn">
</a>
</section>
</section>
<section>
<section>
<h2>Hello World</h2>
<ul>
<li>What's NodeJS</li>
<li>Hello World</li>
<li>Http Server</li>
<li>NPM</li>
<li>Connect middleware</li>
<li>Express</li>
<li>Socket.io</li>
</ul>
</section>
<section>
<h2>What's NodeJS</h2>
<p>Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.</p>
</section>
<section>
<h2>Recommended to read</h2>
<ul>
<li><a href="http://stackoverflow.com/questions/2353818/how-do-i-get-started-with-node-js">How do I get started with Node.js</a></li>
<li><a href="http://www.nodebeginner.org/index-zh-cn.html">Node 入门</a></li>
<li><a href="http://justjavac.com/java/2012/07/23/execution-in-kingdom-of-nouns.html">名词王国里的死刑</a></li>
<li><a href="https://github.com/maxogden/art-of-node">The Art of Node</a></li>
<li><a href="https://github.com/substack/stream-handbook#introduction">why you should use streams</a></li>
<li><a href="http://blog.izs.me/post/48281998870/unix-philosophy-and-node-js">Unix Philosophy and Node.js</a></li>
</ul>
</section>
<section>
<h2>Hello World</h2>
<pre><code contenteditable class="javascript">
//sync
var fs = require('fs');
var data = fs.readFileSync('text.txt', {encoding: 'UTF-8'});
console.log(data);
//async
var fs = require('fs');
fs.readFile('text.txt', {encoding: 'UTF-8'}, function(err, data){
if(err) throw err;
console.log(data);
});
</code></pre>
</section>
<section>
<h2>Hello Node.JS</h2>
<ul>
<li>V8</li>
<li>Non-blocking I/O</li>
<li>Asynchronous</li>
<li>Event-driven</li>
<li>CommonJS</li>
</ul>
</section>
<section>
<h2>Why non-blocking I/O</h2>
<a href="http://www.nearinfinity.com/blogs/jeff_kunkle/nodejs_basics_explained.html">
<img width="600" height="500" src="img/latency-bar-graph.png" alt="Unicorn">
</a>
</section>
<section>
<h2>Event-driven</h2>
<ul>
<li>Asynchronous</li>
<li>EventEmitter</li>
<li>Libev/Libeio/Libuv</li>
</ul>
</section>
<section>
<h2>CommonJS</h2>
<ul>
<li>Binary</li>
<li>FileSystem</li>
<li>Socket</li>
<li>Subprocess</li>
<li>Assert</li>
</ul>
</section>
<section>
<h2>Http Server</h2>
<pre><code contenteditable class="javascript">
var http = require('http');
http.createServer(function(req, res){
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello world\n');
}).listen(8888);
console.log("Server running at http://localhost:8888/");
</code></pre>
</section>
<section>
<h2>NPM</h2>
<ul>
<li>npm install (-g)</li>
<li>npm search</li>
<li>npm list</li>
<li>npm help</li>
</ul>
</section>
<section>
<h2>Connect middleware</h2>
<pre><code contenteditable class="javascript">
var connect = require("connect"),
http = require("http"),
app = connect();
app.use(connect.logger());
app.use(function(req, res){
res.writeHead(200, {"Content-Type": "text/plain"});
res.end("Hello World!\n");
});
http.createServer(app).listen(8888);
</code></pre>
</section>
<section>
<h2>Express</h2>
<ul>
<li>Router</li>
<li>View - Jade</li>
<li>Request/Response handler</li>
</ul>
</section>
<section>
<h2>Socket.io</h2>
<p>
Socket.IO aims to make realtime apps possible in every browser and mobile device, blurring the differences between the different transport mechanisms. It's care-free realtime 100% in JavaScript.
</p>
</section>
</section>
<section>
<section>
<h2>Tools</h2>
<ul>
<li>WebStorm</li>
<li>Mocha</li>
<li>Grunt</li>
<li>Node-inspector</li>
<li>Cluster/Forever</li>
<li>Linux shell</li>
</ul>
</section>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.min.js"></script>
<script>
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/fade/none
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'plugin/markdown/showdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
{ src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } },
// { src: 'plugin/search/search.js', async: true, condition: function() { return !!document.body.classList; } }
{ src: 'plugin/remotes/remotes.js', async: true, condition: function() { return !!document.body.classList; } }
]
});
Reveal.addEventListener('ready', function(){
var jsRuns = document.querySelectorAll('[jsrun]');
for(var i = 0; i < jsRuns.length; i++){
jsRuns[i].addEventListener('click', function(){
var jsrun = this.getAttribute('jsrun');
var js = document.getElementById(jsrun);
eval(js.innerText);
});
}
});
</script>
</body>
</html>