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 Introduction
Search
Brandon Keepers
PRO
March 26, 2012
Programming
1.6k
34
Share
Node.js Introduction
A brief introduction to Node.js given at the
Grand Rapids Web Development Group
.
Brandon Keepers
PRO
March 26, 2012
More Decks by Brandon Keepers
See All by Brandon Keepers
Automating Software Development
bkeepers
PRO
3
570
Building the GitHub workspace app
bkeepers
PRO
1
450
Contributing to Your Career
bkeepers
PRO
4
810
A Maturity Model for Embracing Open Source Software
bkeepers
PRO
3
990
Open Source Principles for Internal Engineering Teams
bkeepers
PRO
8
1.4k
Carbon, Automobiles, Bebop & Fashion
bkeepers
PRO
1
630
Tending Your Open Source Garden, v2
bkeepers
PRO
1
690
Tending Your Open Source Garden
bkeepers
PRO
2
1.1k
The Loyal Renegade
bkeepers
PRO
3
1k
Other Decks in Programming
See All in Programming
事業会社でのセキュリティ長期インターンについて
masachikaura
0
230
アーキテクチャモダナイゼーションとは何か
nwiizo
17
4.6k
条件判定に名前、つけてますか? #phperkaigi #c
77web
2
990
見せてもらおうか、 OpenSearchの性能とやらを!
shunta27
1
180
iOS機能開発のAI環境と起きた変化
ryunakayama
0
170
Vibe하게 만드는 Flutter GenUI App With ADK , 박제창, BWAI Incheon 2026
itsmedreamwalker
0
540
車輪の再発明をしよう!PHP で実装して学ぶ、Web サーバーの仕組みと HTTP の正体
h1r0
3
510
ローカルで稼働するAI エージェントを超えて / beyond-local-ai-agents
gawa
2
260
ネイティブアプリとWebフロントエンドのAPI通信ラッパーにおける共通化の勘所
suguruooki
0
250
Swift Concurrency Type System
inamiy
0
400
年間50登壇、単著出版、雑誌寄稿、Podcast出演、YouTube、CM、カンファレンス主催……全部やってみたので面白さ等を比較してみよう / I’ve tried them all, so let’s compare how interesting they are.
nrslib
4
720
瑠璃の宝石に学ぶ技術の声の聴き方 / 【劇場版】アニメから得た学びを発表会2026 #エンジニアニメ
mazrean
0
190
Featured
See All Featured
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
260
Bash Introduction
62gerente
615
210k
Music & Morning Musume
bryan
47
7.1k
Building AI with AI
inesmontani
PRO
1
870
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
110
Heart Work Chapter 1 - Part 1
lfama
PRO
5
35k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
500
How to Think Like a Performance Engineer
csswizardry
28
2.5k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
Evolving SEO for Evolving Search Engines
ryanjones
0
180
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
350
Transcript
INTRODUCTION
Hi, I’m @bkeepers
None
nodejs.org 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.
server side JavaScript
$ node webserver.js var http = require('http'), server = http.createServer();
server.on('request', function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); }); server.listen(1337, "127.0.0.1"); console.log('Server running at http://127.0.0.1:1337/'); webserver.js
None
event loop modules package management
non-blocking evented I/O
event driven
event driven Button
event driven Button
event driven Button $('button').on('click', function(event) { alert('Event Driven!') });
event driven server.on('request', function(req, res) { res.write(handleRequest(req)) });
non-blocking
None
// blocking var files = fs.readdirSync('/tmp') for(var i = 0;
i < files.length; i++) { var file = files[i]; fs.unlinkSync('/tmp/' + file); console.log('successfully deleted ' + file); }
// blocking var files = fs.readdirSync('/tmp') for(var i = 0;
i < files.length; i++) { var file = files[i]; fs.unlinkSync('/tmp/' + file); console.log('successfully deleted ' + file); } // non-blocking fs.readdir('/tmp', function(err, files) { for(var i = 0; i < files.length; i++) { var file = files[i]; fs.unlink('/tmp/' + file, function (err) { if (err) throw err; console.log('successfully deleted ' + file); }); } });
CommonJS modules
JavaScript Pollutes
JavaScript Pollutes string = "pollution";
None
var http = require('http');
hello.js module.exports = function() { return 'Hello World' };
$ node myapp.js myapp.js var hello = require('./hello.js'); console.log(hello());
package management
npmjs.org
$ npm install <package>
package.json
package.json $ npm install { "name": "myapp", "version": "0.0.1", "dependencies":
{ "socket.io": "0.8.7", "coffee-script": "1.2.0", "spine": "~1.0.5" } }
building the simplest chat app in the world demo
references
http://nodejs.org/api/
None
thanks! @bkeepers