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.7k
34
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
590
Building the GitHub workspace app
bkeepers
PRO
1
480
Contributing to Your Career
bkeepers
PRO
4
830
A Maturity Model for Embracing Open Source Software
bkeepers
PRO
3
1k
Open Source Principles for Internal Engineering Teams
bkeepers
PRO
8
1.5k
Carbon, Automobiles, Bebop & Fashion
bkeepers
PRO
1
670
Tending Your Open Source Garden, v2
bkeepers
PRO
1
720
Tending Your Open Source Garden
bkeepers
PRO
2
1.1k
The Loyal Renegade
bkeepers
PRO
3
1.1k
Other Decks in Programming
See All in Programming
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
240
AIとASP.NET Coreで雑Webアプリを作った話
mayuki
0
600
技術記事、AIに書かせるか、自分で書くか? 〜それでも私が自分の手で書く理由〜 / #QiitaConference
jnchito
2
1.4k
さぁV100、メモリをお食べ・・・
nilpe
0
140
Snowflake Summitでの新機能 CoCo / CoWork / snowflake-summit-2026-overall-what-new-coco
tatsuhiro
1
130
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
21
6.6k
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.6k
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
5.9k
技術記事、 専門家としてのプログラマ、 言語化
mizchi
13
5.8k
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
330
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
350
Dataformのリポジトリを立ち上げるときにまずやること / dataform-day0-2026
snhryt
0
160
Featured
See All Featured
Unsuck your backbone
ammeep
672
58k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
140
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
440
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
300
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
230
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Building Applications with DynamoDB
mza
96
7.1k
A Soul's Torment
seathinner
6
2.9k
A Tale of Four Properties
chriscoyier
163
24k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
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