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
560
Building the GitHub workspace app
bkeepers
PRO
1
450
Contributing to Your Career
bkeepers
PRO
4
800
A Maturity Model for Embracing Open Source Software
bkeepers
PRO
3
980
Open Source Principles for Internal Engineering Teams
bkeepers
PRO
8
1.4k
Carbon, Automobiles, Bebop & Fashion
bkeepers
PRO
1
620
Tending Your Open Source Garden, v2
bkeepers
PRO
1
690
Tending Your Open Source Garden
bkeepers
PRO
2
1k
The Loyal Renegade
bkeepers
PRO
3
1k
Other Decks in Programming
See All in Programming
CSC307 Lecture 08
javiergs
PRO
0
690
Beyond the Basics: Signal Forms
manfredsteyer
PRO
0
100
クライアントワークでSREをするということ。あるいは事業会社におけるSREと同じこと・違うこと
nnaka2992
1
190
Go Conference mini in Sendai 2026 : Goに新機能を提案し実装されるまでのフロー徹底解説
yamatoya
0
450
AIに仕事を丸投げしたら、本当に楽になれるのか
dip_tech
PRO
0
170
Claude Codeセッション現状確認 2026福岡 / fukuoka-aicoding-00-beacon
monochromegane
3
340
Claude Codeと2つの巻き戻し戦略 / Two Rewind Strategies with Claude Code
fruitriin
0
200
AI主導でFastAPIのWebサービスを作るときに 人間が構造化すべき境界線
okajun35
0
390
AHC061解説
shun_pi
0
260
20260228_JAWS_Beginner_Kansai
takuyay0ne
4
360
The Ralph Wiggum Loop: First Principles of Autonomous Development
sembayui
0
3.7k
Python’s True Superpower
hynek
0
190
Featured
See All Featured
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
140
How to Talk to Developers About Accessibility
jct
2
140
From π to Pie charts
rasagy
0
140
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
62
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
620
Done Done
chrislema
186
16k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
First, design no harm
axbom
PRO
2
1.1k
Color Theory Basics | Prateek | Gurzu
gurzu
0
220
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.3k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.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