SlideShare ist ein Scribd-Unternehmen logo
1 von 124
Downloaden Sie, um offline zu lesen
yet another talk on
  node.js
 getting started


       @philhawksworth
what we’ll look at
       whaddizit?
   installation options
       hello world
  modules & frameworks
   deploying & hosting
   comet and beyond
assumptions
web development experience
   javascript knowledge
       unix, linux, osx
     not a nodejs ninja
whaddizit?
Evented I/O for
V8 Javascript
evented i-what now?
           c++
   v8 javascript engine
  server-side javascript
    single event loop
       non-blocking
useful knowledge
  strong javascript
   jQuery patterns
dangerous knowledge
     jQuery patterns
considerations
     how mature is it?
v0.0.1: early 2009, currently v.0.4.8

        who uses it?
        everyone is playing.
considerations
     how mature is it?
v0.0.1: early 2009, currently v.0.4.8

        who uses it?
        everyone is playing.

should I be scared of it?
        no. but be cautious.
ball-ache:
  stability
 rate of change
installation
  options
 build from source
      package
       ndistro
          n
from source
  clone source from github
    install dependancies
         xcode tools
configure, make, make install
package
ball-ache:
  stability
 rate of change
many versions
many versions
many versions
  ndistro & n
ndistro
node distribution toolkit
enables many
versions of node
http://github.com/visionmedia/ndistro
http://github.com/visionmedia/ndistro
local versions
for each project
n
install as a module
ball-ache
version stability
module stability
installing modules
      npm
node package manager
curl http://npmjs.org/install.sh | sh
$ npm install <package>
$ npm install n
$ npm install n@0.4.1
$ npm ls
!"# express@2.2.2
$ !"# connect@1.3.0
$ $ !"" mime@1.2.1
$ $ %"" qs@0.1.0
$ !"" mime@1.2.1
$ %"" qs@0.1.0
!"" n@0.4.1
%"" underscore@1.1.6
!"# express@2.2.2
$ !"# connect@1.3.0
$ $ !"" mime@1.2.1
$ $ %"" qs@0.1.0
$ !"" mime@1.2.1
$ %"" qs@0.1.0
!"" n@0.4.1
%"" underscore@1.1.6
$ npm update n
$ npm install n
$ npm update npm
n
while ndistro
 is for virtual
environments
while ndistro
  is for local
environments
n gives
 system wide
node versioning
$ n 0.2.6
$ n v0.3.3
download
configure
  make
  install
$ n ls
$ n
0.2.3
  0.2.6 --debug
  0.3.4
  0.3.5
ο 0.4.8
$ n use 0.4.8
what we’ll look at
       whaddizit?
   installation options
       hello world
  modules & frameworks
   deploying & hosting
   comet and beyond
hello world
app.js



         hello world
$ node app.js
$ ./bin/node app.js
$ n use 0.4.8 app.js
frameworks
     get a little help

        uri routing
   content negotiation
       templating
environment configuration
express
   the canonical web
development framework
    http://expressjs.com
templating
many ways to render
  your response
bootstrapping
  quick scaffolding
$ express
   --template
   --css
   --session
$ n use 0.4.8 app.js
deploying
where do I put this thing?

     self-managed
 amazon, linode, slicehost
       managed
        heroku, no.de
duostack
 automated, git-based
     deployment
     install via npm
manage dependancies
     via npm
limited versions of nodejs
server.js



        hello world
$ git init
$ git add
$ git commit -m ‘1st commit’
$ duostack create nodedemo
$ git push duostack master
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 416 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)

====   Duostack deploy received for nodedemo
====   Compiling app... done
       Compressed size is 4.0KB
====   Launching first instances.... done

====   App successfully deployed to
====   http://nodedemo.duostack.net
self-managed
amazon, linode, slicehost
deploying
       get it there
             git

      configure it
     install dependencies

get it up, and keep it up
           upstart
$ git clone project.git
$ cd project
$ ndistro
ndistro is really
 just the shell
replicates your
 environment
keeping it up
$ /etc/init.d/
http://upstart.ubuntu.com/
what we’ll look at
       whaddizit?
   installation options
       hello world
  modules & frameworks
   deploying & hosting
   comet and beyond
easy comet requests
    websockets
comet
long-lived http requests
javascript on the client
     asks, and listens
asks again, or takes action
websockets
more efficient low latency comms
supported in
modern browsers
Graceful degradation
WebSocket
  Adobe Flash Socket
    Ajax long polling
Ajax multipart streaming
     Forever Iframe
     JSONP Polling
but...
node is not just for realtime
staying in
  the loop
and finding out more
github wiki
github.com/joyent/node/wiki
irc
irc.freenode.net
     #node.js
github wiki
@ryah
@tjholowaychuk
    @isaacs
  @sh1mmer
ta!
hawksworx.com
@philhawksworth

Weitere ähnliche Inhalte

Was ist angesagt?

Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applications
Tom Croucher
 
Building servers with Node.js
Building servers with Node.jsBuilding servers with Node.js
Building servers with Node.js
ConFoo
 
Java script at backend nodejs
Java script at backend   nodejsJava script at backend   nodejs
Java script at backend nodejs
Amit Thakkar
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js Tutorial
Tom Croucher
 

Was ist angesagt? (20)

Nodejs presentation
Nodejs presentationNodejs presentation
Nodejs presentation
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applications
 
node.js: Javascript's in your backend
node.js: Javascript's in your backendnode.js: Javascript's in your backend
node.js: Javascript's in your backend
 
Server Side Event Driven Programming
Server Side Event Driven ProgrammingServer Side Event Driven Programming
Server Side Event Driven Programming
 
All aboard the NodeJS Express
All aboard the NodeJS ExpressAll aboard the NodeJS Express
All aboard the NodeJS Express
 
Node.js Explained
Node.js ExplainedNode.js Explained
Node.js Explained
 
Nodejs Event Driven Concurrency for Web Applications
Nodejs Event Driven Concurrency for Web ApplicationsNodejs Event Driven Concurrency for Web Applications
Nodejs Event Driven Concurrency for Web Applications
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
Building servers with Node.js
Building servers with Node.jsBuilding servers with Node.js
Building servers with Node.js
 
Java script at backend nodejs
Java script at backend   nodejsJava script at backend   nodejs
Java script at backend nodejs
 
Node Architecture and Getting Started with Express
Node Architecture and Getting Started with ExpressNode Architecture and Getting Started with Express
Node Architecture and Getting Started with Express
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js Tutorial
 
NodeJS guide for beginners
NodeJS guide for beginnersNodeJS guide for beginners
NodeJS guide for beginners
 
Intro to node and non blocking io
Intro to node and non blocking ioIntro to node and non blocking io
Intro to node and non blocking io
 
Non-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.jsNon-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.js
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
 
Intro to Node.js (v1)
Intro to Node.js (v1)Intro to Node.js (v1)
Intro to Node.js (v1)
 
Node ppt
Node pptNode ppt
Node ppt
 
Node.js Workshop - Sela SDP 2015
Node.js Workshop  - Sela SDP 2015Node.js Workshop  - Sela SDP 2015
Node.js Workshop - Sela SDP 2015
 

Andere mochten auch

NodeJS for Novices - 28/Oct/13 - Winnipeg, MB
NodeJS for Novices - 28/Oct/13 - Winnipeg, MBNodeJS for Novices - 28/Oct/13 - Winnipeg, MB
NodeJS for Novices - 28/Oct/13 - Winnipeg, MB
David Wesst
 
Asynchronous I/O in NodeJS - new standard or challenges?
Asynchronous I/O in NodeJS - new standard or challenges?Asynchronous I/O in NodeJS - new standard or challenges?
Asynchronous I/O in NodeJS - new standard or challenges?
Dinh Pham
 
Top mobile internet trends feb11
Top mobile internet trends feb11Top mobile internet trends feb11
Top mobile internet trends feb11
Hope Hong
 
Pilonidaldisease 141115134308-conversion-gate01
Pilonidaldisease 141115134308-conversion-gate01Pilonidaldisease 141115134308-conversion-gate01
Pilonidaldisease 141115134308-conversion-gate01
Haliunaa Battulga
 

Andere mochten auch (20)

NodeJS: the good parts? A skeptic’s view (devnexus2014)
NodeJS: the good parts? A skeptic’s view (devnexus2014)NodeJS: the good parts? A skeptic’s view (devnexus2014)
NodeJS: the good parts? A skeptic’s view (devnexus2014)
 
NodeJS for Novices - 28/Oct/13 - Winnipeg, MB
NodeJS for Novices - 28/Oct/13 - Winnipeg, MBNodeJS for Novices - 28/Oct/13 - Winnipeg, MB
NodeJS for Novices - 28/Oct/13 - Winnipeg, MB
 
(C)NodeJS
(C)NodeJS(C)NodeJS
(C)NodeJS
 
NodeJS: the good parts? A skeptic’s view (oredev, oredev2013)
NodeJS: the good parts? A skeptic’s view (oredev, oredev2013)NodeJS: the good parts? A skeptic’s view (oredev, oredev2013)
NodeJS: the good parts? A skeptic’s view (oredev, oredev2013)
 
Why You Are Not Your Type's Type
Why You Are Not Your Type's TypeWhy You Are Not Your Type's Type
Why You Are Not Your Type's Type
 
Oxford Dogma catalog of handcrafted dog accessories
Oxford Dogma catalog of handcrafted dog accessoriesOxford Dogma catalog of handcrafted dog accessories
Oxford Dogma catalog of handcrafted dog accessories
 
Coulta Crosby Catalog
Coulta Crosby CatalogCoulta Crosby Catalog
Coulta Crosby Catalog
 
Asynchronous I/O in NodeJS - new standard or challenges?
Asynchronous I/O in NodeJS - new standard or challenges?Asynchronous I/O in NodeJS - new standard or challenges?
Asynchronous I/O in NodeJS - new standard or challenges?
 
Why Your 5-Year-Old is More Digital Than Most CMOs - Sean Miller, R/GA and J...
Why Your 5-Year-Old is More Digital Than Most CMOs -  Sean Miller, R/GA and J...Why Your 5-Year-Old is More Digital Than Most CMOs -  Sean Miller, R/GA and J...
Why Your 5-Year-Old is More Digital Than Most CMOs - Sean Miller, R/GA and J...
 
Testing NodeJS Security
Testing NodeJS SecurityTesting NodeJS Security
Testing NodeJS Security
 
I May Like You, But I'm Not In LIke With You - Chloe Gottlieb, R/GA
I May Like You, But I'm Not In LIke With You - Chloe Gottlieb, R/GAI May Like You, But I'm Not In LIke With You - Chloe Gottlieb, R/GA
I May Like You, But I'm Not In LIke With You - Chloe Gottlieb, R/GA
 
NodeJS: the good parts? A skeptic’s view (jax jax2013)
NodeJS: the good parts? A skeptic’s view (jax jax2013)NodeJS: the good parts? A skeptic’s view (jax jax2013)
NodeJS: the good parts? A skeptic’s view (jax jax2013)
 
IT’S AN “M” WORLD - 9+1 Learnings to Build a Path to Success
IT’S AN “M” WORLD - 9+1 Learnings to Build a Path to SuccessIT’S AN “M” WORLD - 9+1 Learnings to Build a Path to Success
IT’S AN “M” WORLD - 9+1 Learnings to Build a Path to Success
 
Taking Hollywood Out of Production
Taking Hollywood Out of ProductionTaking Hollywood Out of Production
Taking Hollywood Out of Production
 
What got you here won't get you there
What got you here won't get you thereWhat got you here won't get you there
What got you here won't get you there
 
The Sports Fan in 2015 - Richard Ting and Kyle Bunch, R/GA
The Sports Fan in 2015 - Richard Ting and Kyle Bunch, R/GAThe Sports Fan in 2015 - Richard Ting and Kyle Bunch, R/GA
The Sports Fan in 2015 - Richard Ting and Kyle Bunch, R/GA
 
Top mobile internet trends feb11
Top mobile internet trends feb11Top mobile internet trends feb11
Top mobile internet trends feb11
 
¿POR QUÉ TANGO?
¿POR QUÉ TANGO?¿POR QUÉ TANGO?
¿POR QUÉ TANGO?
 
Pilonidaldisease 141115134308-conversion-gate01
Pilonidaldisease 141115134308-conversion-gate01Pilonidaldisease 141115134308-conversion-gate01
Pilonidaldisease 141115134308-conversion-gate01
 
Word of-mouth
Word of-mouthWord of-mouth
Word of-mouth
 

Ähnlich wie Getting started with developing Nodejs

Webconf nodejs-production-architecture
Webconf nodejs-production-architectureWebconf nodejs-production-architecture
Webconf nodejs-production-architecture
Ben Lin
 

Ähnlich wie Getting started with developing Nodejs (20)

introduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraformintroduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraform
 
Dcjq node.js presentation
Dcjq node.js presentationDcjq node.js presentation
Dcjq node.js presentation
 
Node js introduction
Node js introductionNode js introduction
Node js introduction
 
Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.js
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
 
Open shift
Open shiftOpen shift
Open shift
 
Webconf nodejs-production-architecture
Webconf nodejs-production-architectureWebconf nodejs-production-architecture
Webconf nodejs-production-architecture
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
 
Intro To Node.js
Intro To Node.jsIntro To Node.js
Intro To Node.js
 
codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014
 
Boxen: How to Manage an Army of Laptops
Boxen: How to Manage an Army of LaptopsBoxen: How to Manage an Army of Laptops
Boxen: How to Manage an Army of Laptops
 
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
 
Node.js vs Play Framework
Node.js vs Play FrameworkNode.js vs Play Framework
Node.js vs Play Framework
 
Introduction to node.js By Ahmed Assaf
Introduction to node.js  By Ahmed AssafIntroduction to node.js  By Ahmed Assaf
Introduction to node.js By Ahmed Assaf
 
Node js presentation
Node js presentationNode js presentation
Node js presentation
 
S&T What I know about Node 110817
S&T What I know about Node 110817S&T What I know about Node 110817
S&T What I know about Node 110817
 
Node.js - The New, New Hotness
Node.js - The New, New HotnessNode.js - The New, New Hotness
Node.js - The New, New Hotness
 
우리가 모르는 노드로 할 수 있는 몇가지
우리가 모르는 노드로 할 수 있는 몇가지우리가 모르는 노드로 할 수 있는 몇가지
우리가 모르는 노드로 할 수 있는 몇가지
 
[H3 2012] 우리가 모르는 Node.js로 할 수 있는 몇가지
[H3 2012] 우리가 모르는 Node.js로 할 수 있는 몇가지[H3 2012] 우리가 모르는 Node.js로 할 수 있는 몇가지
[H3 2012] 우리가 모르는 Node.js로 할 수 있는 몇가지
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Getting started with developing Nodejs