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
gfnork node.js workshop Lesson #3 node.js basics
Search
gfnork
June 20, 2014
Programming
480
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
gfnork node.js workshop Lesson #3 node.js basics
first steps, modules, npm, Events
gfnork
June 20, 2014
More Decks by gfnork
See All by gfnork
Basic Mobile Application Design
freundschaft
0
540
gfnork node.js workshop Lesson #1 JavaScript Basics
freundschaft
0
990
gfnork node.js workshop Lesson #2 JavaScript Async
freundschaft
0
1k
gfnork node.js workshop Lesson #4 middleware for node
freundschaft
0
530
gfnork node.js workshop Lesson #5 node.js databases
freundschaft
0
480
gfnork node.js workshop Lesson #6 Unit testing
freundschaft
0
470
Other Decks in Programming
See All in Programming
VueプロジェクトをTypeScript7に対応させる- Side-by-Side戦略による一部高速化 -
koukimiura
0
110
TiDB Cloudのカスタムコントローラーによるオートスケール対応
takaidohigasi
0
100
XP祭りでしか伝わらないフリップネタ #xpjug
murabayashi
0
150
WebMCP Challenge に星空観察アプリで参加した話
okajun35
0
160
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
140
モバイル交通系ICへのチャージ実例から考える、クロスプラットフォーム開発におけるiOS実機テスト設計とCI運用
yusuga
1
450
JPUG勉強会 OSSデータベースの内部構造を理解しよう(第2回)
oga5
0
190
Claude Codeを組織的に動かして月400PRを実現した話
happy_ryo
0
270
Can LLMs Replicate 4 Years of Compose Migration? Exploring the boundaries of automation with 279 XML files from a real product
makun
0
140
[DroidKaigi 2026] Bring your own phones to Gradle Managed Devices
f2lk
0
120
AIエージェント時代のコードレビューを設計する
nogu66
6
2.7k
【DroidKaigi 2026】「アクセシビリティを利用するとき、 アクセシビリティもまたこちらを利用している」 〜マルウェアによる攻撃と防衛について〜
halunoyo
0
460
Featured
See All Featured
Become a Pro
speakerdeck
PRO
31
6.2k
SEO for Brand Visibility & Recognition
aleyda
0
4.7k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
250
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Product Roadmaps are Hard
iamctodd
55
13k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
520
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
240
4 Signs Your Business is Dying
shpigford
187
23k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
230
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
RailsConf 2023
tenderlove
30
1.5k
Transcript
None
2
3
4
5
6
7
8 node > console.log('Hello World'); Hello World
9 console.log('Hello World'); >node app.js Hello World
10 var http = require('http'); http.createServer(function (req, res) { res.writeHead(200,
{ 'Content-Type': 'text/plain' }); res.end('Hello World\n'); }).listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/');
11 var http = require('http'); http.createServer(function (req, res) { res.writeHead(200,
{ 'Content-Type': 'text/plain' }); res.end('Hello World\n'); }).listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/');
12
13 exports.helloworld = function () { console.log('Hello World'); } var
test = require('./test.js'); test.helloworld();
14 module.exports = function () { this.name = "test object";
this.color = "red"; this.size = "large"; } var test = require('./test.js'); var testObject = new test(); console.log('name:' + testObject.name); console.log('color:' + testObject.color); console.log('size:' + testObject.size);
15
16
17 { "name": "TestNodejsApp", "version": "0.0.0", "description": "TestNodejsApp", "private": true,
"main": "app.js", "author": { "name": "Qiong Wu", "email": "" }, "dependencies": { "express": "3.4.4", "jade": "*", "stylus": "*" } }
18
19
20 server.on('connection', function (stream) { console.log('someone connected!'); }); server.once('connection', function
(stream) { console.log('Ah, we have our first user!'); });
21 function Test(colour) { this.colour = colour; events.EventEmitter.call(this); this.sendEvent =
function() { this.emit('EventSent'); } } Test.prototype.__proto__ = events.EventEmitter.prototype; var testObject = new Test('white'); testObject.on('EventSent', function() { console.log('Event received'); }); testObject.sendEvent();
22
23 // write 'hello, ' and then end with 'world!'
http.createServer(function (req, res) { res.write('hello, '); res.end('world!'); // writing more now is not allowed! });
24