Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Build Your Application On Node.js
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
mahdi pedramrazi
March 21, 2014
Programming
140
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Build Your Application On Node.js
mahdi pedramrazi
March 21, 2014
More Decks by mahdi pedramrazi
See All by mahdi pedramrazi
CSS Shapes
pedramphp
1
71
Node.js Application Architecture.
pedramphp
0
870
CSS Best Practices
pedramphp
0
140
How to write UI Components
pedramphp
0
100
Other Decks in Programming
See All in Programming
phperだってパンチカードでコーディングしたい
o0h
PRO
0
340
Optunaを作ったときにやりたかったこと、その後 (2026/10/16, Optuna Meetup #3)
iwiwi
1
440
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
270
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
280
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
600
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
150
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
540
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
390
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
120
すこし踏み込む CancellationToken
htkym
2
1.7k
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
140
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
220
Featured
See All Featured
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.4k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
570
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.2k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
410
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
58k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
Code Reviewing Like a Champion
maltzj
529
40k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
520
Design in an AI World
tapps
1
350
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
750
Transcript
Build Your Applica.on On Node.js Mahdi Pedramrazi
Agenda • What is Node.js • Hello world
with Node.js • Node modules • Callback Hell vs Modular Code • Promises
What is Node.js • PlaDorm built on Chrome's JavaScript
run.me (V8 JavaScript engine) • Building fast, scalable Internet applica.ons. • Event-‐driven, non-‐blocking I/O model • Lightweight and efficient • 8000 lines of C/C++, 2000 lines of Javascript • 14 contributors. ( 2009 )
Event Loop • Single threaded • Doesn’t spend
.me wai.ng for things to finish • Sequen.ally execute a number of tasks very rapidly
Hello World • Download Node.js from h`p://nodejs.org •
Install Node.js • Open your Terminal • Type “node” • Type “console.log(‘Hello World’);
Hello World on Your Server Open Terminal and Type:
node helloworld.js
How to Load Modules. // Node Built In modules
var h`p = require('h`p'); //custom modules var customModule = require('path/to/your/module');
Node Modules h`p://nodejs.org/api/ 35+ Build In Modules
require(“h`p”); require(“path”); require(“process”); require(“os”);
How to load dependencies Package.json cheatsheet
How to load Public Modules NPM ( Node Packaged
Modules ) npmjs.org In the root folder run: “npm install” loads all dependencies from package.json //updates package.json Npm install –save moment
Asynchronous Model quiz var ac.on_one = RPS.getEvents(func.on(){ console.log(arguments);
}); var ac.on_two = RPS.getEvent(“test”, func.on(){ console.log(arguments); }); var Ac.on_three = require('events').EventEmi`er;
Callback Hell
Name Your Func.on
Reduce Nes.ng
None
Modularize!
Issac Schlueter (NPM Developer ) Write small modules that
each do one thing, and assemble them into other modules that do a bigger thing. You can't get into callback hell if you don't go there.
CommonJS • Modern JavaScript Design pa`ern. • CommonJS
module is a reusable piece of JavaScript which exports specific objects made available to any dependent code. • Unlike AMD, there are typically no func.on wrappers around such modules (so we won't see define here for example).
CommonJS to the rescue Formuploader.js
Callback hell vs Modular code
Paradigm of Doom the situa.on where code marches to
the right faster than it marches forward.
Callback Limita.ons Dependency Management can become messy
Error Handling is a Nightmare
Promises Represents a proxy for a value which
is not known at it’s crea.on .me.
Promise Fulfilled The ac.on rela.ng to the promise
succeeded
Promise Rejected The ac.on rela.ng to the promise
Failed
Promise Pending Hasn’t fulfilled or rejected yet
Promise se`led Has Fulfilled or rejected
Promise Libraries • Q • When
• RQ ( Doug Crockford ) • Deffered • Async
Q – Promise
Se`led • Use allSe`led If you want to wait
for all of the promises to either be fulfilled or rejected.
Q -‐ Error Handling
Q -‐ Progress no.fica.on
How to Create a Promise Func.on
None
Q – Promise Example
Useful Links Express -‐ Web development framework for
Node.js Tips, Libraries, Tutorials Q.Js Node Inspector