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
S3 を使うアプリケーションをローカル完結で動かすことに全力を注いでみた / Running S3 Apps Offline
contour_gara
0
670
FastAPI の並行処理モデルを完全に理解する
hoto17296
8
3.2k
AIの中の人になってみる
htkym
0
140
【デモ】Kiroで体験する仕様駆動開発|設計からコーディングまでAIと進める開発フロー
cmkudo
0
500
プロポーザルを書いてもらう
pvcresin
0
590
まだ間に合う!今年の夏こそSchemeのマクロ展開器を完全理解!
omasanori
0
570
Claude Code全社展開のためにやったことn選~プラグイン302個・コミッター271人を支えるために~
kenchan
5
1.8k
コンパウンドプロダクト開発のためのローカルプロセスマネージャー再発明 #layerxgo
izumin5210
0
470
ドリフトを絶対に許さない(?)CDK運用 / CDK Ops with Zero Tolerance for Drifts (?)
akihisaikeda
1
240
業務時間外もAIに働いてもらう話
colorful12
2
8.7k
「人を評価する AI」の設計と実装
ryoyanara
0
260
複数の Claude Code が"放置"されてしまう問題をCLI ダッシュボードを自作して解決した話
sumihiro3
1
740
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
490
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.8k
Google's AI Overviews - The New Search
badams
0
1.6k
Navigating Team Friction
lara
192
16k
4 Signs Your Business is Dying
shpigford
187
23k
Design in an AI World
tapps
1
290
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
430
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
880
Large-scale JavaScript Application Architecture
addyosmani
515
110k
A Tale of Four Properties
chriscoyier
163
24k
We Have a Design System, Now What?
morganepeng
55
8.3k
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