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
600
Building the GitHub workspace app
bkeepers
PRO
1
500
Contributing to Your Career
bkeepers
PRO
4
850
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
680
Tending Your Open Source Garden, v2
bkeepers
PRO
1
740
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
AIの中の人になってみる
htkym
0
140
書籍「プロフェッショナルAI駆動開発」紹介スライド
juntaromatsumoto
0
780
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
290
Pythonの実行はどこまで賢くなったのか? CPythonとPyPyから見る最適化のしくみ
curekoshimizu
4
2.3k
Detecting Compromised CI with eBPF and Cilium Tetragon
lizrice
0
270
ALB ログから Trace を気合で繋げる技術
fohte
7
770
React本体のコードリーディング
high_g_engineer
1
160
T3DD26: From RAGs to Riches
martinhelmich
0
120
Jindong: Introducing Declarative Haptics in Compose Multiplatform
l2hyunwoo
0
130
高専キャリア LT 発表内容
crysta1221
4
4.3k
KotlinConf Extended South Korea 2026 Keynote
l2hyunwoo
0
120
AI Engineeringは、AIプロダクトだけのものか? 〜AIがソフトウェアを作る時代の新しい当たり前〜 / No AI in your product. AI Engineering in your development.
rkaga
5
550
Featured
See All Featured
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
580
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.4k
Speed Design
sergeychernyshev
33
2k
Designing Powerful Visuals for Engaging Learning
tmiket
1
510
Prompt Engineering for Job Search
mfonobong
0
420
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
500
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
The browser strikes back
jonoalderson
0
1.6k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.1k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.9k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
480
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.5k
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