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
34
1.6k
Node.js Introduction
A brief introduction to Node.js given at the
Grand Rapids Web Development Group
.
Brandon Keepers
PRO
March 26, 2012
Tweet
Share
More Decks by Brandon Keepers
See All by Brandon Keepers
Automating Software Development
bkeepers
PRO
3
530
Building the GitHub workspace app
bkeepers
PRO
1
430
Contributing to Your Career
bkeepers
PRO
4
780
A Maturity Model for Embracing Open Source Software
bkeepers
PRO
3
960
Open Source Principles for Internal Engineering Teams
bkeepers
PRO
8
1.4k
Carbon, Automobiles, Bebop & Fashion
bkeepers
PRO
1
600
Tending Your Open Source Garden, v2
bkeepers
PRO
1
670
Tending Your Open Source Garden
bkeepers
PRO
2
1k
The Loyal Renegade
bkeepers
PRO
3
980
Other Decks in Programming
See All in Programming
從冷知識到漏洞,你不懂的 Web,駭客懂 - Huli @ WebConf Taiwan 2025
aszx87410
2
3.2k
re:Invent 2025 のイケてるサービスを紹介する
maroon1st
0
160
AIの誤りが許されない業務システムにおいて“信頼されるAI” を目指す / building-trusted-ai-systems
yuya4
6
4.1k
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
7
2.4k
公共交通オープンデータ × モバイルUX 複雑な運行情報を 『直感』に変換する技術
tinykitten
PRO
0
170
愛される翻訳の秘訣
kishikawakatsumi
3
360
[AtCoder Conference 2025] LLMを使った業務AHCの上⼿な解き⽅
terryu16
6
960
TestingOsaka6_Ozono
o3
0
230
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
2.1k
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
4
1k
AtCoder Conference 2025
shindannin
0
840
これならできる!個人開発のすゝめ
tinykitten
PRO
0
140
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
77
5.2k
Ethics towards AI in product and experience design
skipperchong
1
150
Odyssey Design
rkendrick25
PRO
0
450
We Have a Design System, Now What?
morganepeng
54
8k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
110
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
1
37
A better future with KSS
kneath
240
18k
Building AI with AI
inesmontani
PRO
1
590
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
410
sira's awesome portfolio website redesign presentation
elsirapls
0
94
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.4k
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