Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Node.js Introduction
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
520
Building the GitHub workspace app
bkeepers
PRO
1
430
Contributing to Your Career
bkeepers
PRO
4
770
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
580
Tending Your Open Source Garden, v2
bkeepers
PRO
1
650
Tending Your Open Source Garden
bkeepers
PRO
2
1k
The Loyal Renegade
bkeepers
PRO
3
950
Other Decks in Programming
See All in Programming
AIの弱点、やっぱりプログラミングは人間が(も)勉強しよう / YAPC AI and Programming
kishida
6
3.4k
Claude Code on the Web を超える!? Codex Cloud の実践テク5選
sunagaku
0
460
Kotlin 2.2が切り拓く: コンテキストパラメータで書く関数型DSLと新しい依存管理のかたち
knih
0
400
Core MIDI を勉強して作曲用の電子ピアノ作ってみた!
hypebeans
0
100
CSC509 Lecture 10
javiergs
PRO
0
170
ビルドプロセスをデバッグしよう!
yt8492
0
280
FlutterKaigi 2025 システム裏側
yumnumm
0
700
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
410
なんでRustの環境構築してないのにRust製のツールが動くの? / Why Do Rust-Based Tools Run Without a Rust Environment?
ssssota
15
48k
MCPサーバー「モディフィウス」で変更容易性の向上をスケールする / modifius
minodriven
7
1.4k
What's New in Web AI?
christianliebel
PRO
0
120
Blazing Fast UI Development with Compose Hot Reload (droidcon London 2025)
zsmb
0
500
Featured
See All Featured
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
Designing for humans not robots
tammielis
254
26k
Side Projects
sachag
455
43k
Making Projects Easy
brettharned
120
6.4k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
658
61k
Embracing the Ebb and Flow
colly
88
4.9k
The Language of Interfaces
destraynor
162
25k
Site-Speed That Sticks
csswizardry
13
960
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
11
920
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