SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Node.js

HP.com Brown Bag Session
      15 Feb 2012
          Alif
What?!

    Server-side javascript

 Built on top of Chrome V8 –
   insanely fast, and getting better every day


http://code.google.com/p/v8/

       C: node server.js
Some facts..

       Not a web framework..
    Non blocking I/O – event loop
Not written in javascript itself. It’s in C.

              Javascript is only,
                       Function
                        Object
                       Number
                        String
                        Array

   Wasn’t designed for TCP / network stuff by nature
Why

Node's goal is to provide an easy
 way to build scalable network
          programs.
How

Keep slow operations from
blocking other operations.
Traditional I/O

var data = file.read('file.txt');
  doSomethingWith(data);



Something is not right here
FAIL !

var data = file.read('file.txt');
    // zzzZZzzz … …. … . . .
  doSomethingWith(data);



 Don’t waste those cycles!
Async I/O
file.read('file.txt', function(data) {
      doSomethingWith(data);
                   });
        doSomethingElse();

            WIN !
  No need to wait for the disk,
 do something else meanwhile!
Seriously, why javascript though :/


    De facto standard language for web
                programming

     do not underestimate javascript,
      https://github.com/languages
Nodejs is…
                - Immature
  - Not yet proven at large scale code size

                         Interesting reading:
        http://teddziuba.com/2011/10/node-js-is-cancer.html




it's opaque and weird to most but completely
            usable for a small group
Best use for..

           JSON APIs –
       heavy ajax call consumption


       Streaming data –
     parsing file uploads in real time


Soft Realtime Applications –
  chat/IM, twitter, realtime scoreboards
Who use it

                Real world app,
https://github.com/joyent/node/wiki/Projects,-
    Applications,-and-Companies-Using-Node

         .. growing rapidly each days
The beauty of Node is that you can write
entirely simple and mundane JavaScript to get
                 these results.
Node Modules
  NPM – Node package manager
    http://search.npmjs.org/

 C: npm install express jade stylus

Or, define it in package.json format,




     Then just hit npm install
{ live demo session }

Stalk here for more gossips:
      http://nodejs.org
   http://howtonode.org

Weitere ähnliche Inhalte

Was ist angesagt?

Integrating Node.js with PHP
Integrating Node.js with PHPIntegrating Node.js with PHP
Integrating Node.js with PHP
Lee Boynton
 
Webconf nodejs-production-architecture
Webconf nodejs-production-architectureWebconf nodejs-production-architecture
Webconf nodejs-production-architecture
Ben Lin
 
NodeJs Intro - JavaScript Zagreb Meetup #1
NodeJs Intro - JavaScript Zagreb Meetup #1NodeJs Intro - JavaScript Zagreb Meetup #1
NodeJs Intro - JavaScript Zagreb Meetup #1
Tomislav Capan
 

Was ist angesagt? (20)

Integrating Node.js with PHP
Integrating Node.js with PHPIntegrating Node.js with PHP
Integrating Node.js with PHP
 
Future of NodeJS
Future of NodeJSFuture of NodeJS
Future of NodeJS
 
Horizontally Scaling Node.js and WebSockets
Horizontally Scaling Node.js and WebSocketsHorizontally Scaling Node.js and WebSockets
Horizontally Scaling Node.js and WebSockets
 
Webconf nodejs-production-architecture
Webconf nodejs-production-architectureWebconf nodejs-production-architecture
Webconf nodejs-production-architecture
 
[5분 따라하기] 비주얼 스튜디오 C++에서 JSON 파서 설치하기
[5분 따라하기] 비주얼 스튜디오 C++에서 JSON 파서 설치하기[5분 따라하기] 비주얼 스튜디오 C++에서 JSON 파서 설치하기
[5분 따라하기] 비주얼 스튜디오 C++에서 JSON 파서 설치하기
 
Node js introduction
Node js introductionNode js introduction
Node js introduction
 
SFScon 2020 - Riccardo Magliocchetti - Avoiding spelling mistakes a WebAssemb...
SFScon 2020 - Riccardo Magliocchetti - Avoiding spelling mistakes a WebAssemb...SFScon 2020 - Riccardo Magliocchetti - Avoiding spelling mistakes a WebAssemb...
SFScon 2020 - Riccardo Magliocchetti - Avoiding spelling mistakes a WebAssemb...
 
Web pack and friends
Web pack and friendsWeb pack and friends
Web pack and friends
 
NodeJs Intro - JavaScript Zagreb Meetup #1
NodeJs Intro - JavaScript Zagreb Meetup #1NodeJs Intro - JavaScript Zagreb Meetup #1
NodeJs Intro - JavaScript Zagreb Meetup #1
 
(C)NodeJS
(C)NodeJS(C)NodeJS
(C)NodeJS
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Let s Enjoy Node.js
Let s Enjoy Node.jsLet s Enjoy Node.js
Let s Enjoy Node.js
 
Daniel Steigerwald: EsteJS - javascriptové aplikace robusně, modulárně a komf...
Daniel Steigerwald: EsteJS - javascriptové aplikace robusně, modulárně a komf...Daniel Steigerwald: EsteJS - javascriptové aplikace robusně, modulárně a komf...
Daniel Steigerwald: EsteJS - javascriptové aplikace robusně, modulárně a komf...
 
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.jsThe MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
 
Вредные советы .NET разработчикам, Сергей Калинец
Вредные советы .NET разработчикам, Сергей КалинецВредные советы .NET разработчикам, Сергей Калинец
Вредные советы .NET разработчикам, Сергей Калинец
 
Daniel Steigerwald - Este.js - konec velkého Schizma
Daniel Steigerwald - Este.js - konec velkého SchizmaDaniel Steigerwald - Este.js - konec velkého Schizma
Daniel Steigerwald - Este.js - konec velkého Schizma
 
Full stack java script development
Full stack java script developmentFull stack java script development
Full stack java script development
 
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
 
WebUSB
WebUSBWebUSB
WebUSB
 
Best node js course
Best node js courseBest node js course
Best node js course
 

Ähnlich wie Node.js

Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdfNode.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
lubnayasminsebl
 

Ähnlich wie Node.js (20)

02 Node introduction
02 Node introduction02 Node introduction
02 Node introduction
 
Nodejs
NodejsNodejs
Nodejs
 
Nodejs
NodejsNodejs
Nodejs
 
Node js
Node jsNode js
Node js
 
Basic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBasic Concept of Node.js & NPM
Basic Concept of Node.js & NPM
 
Node.js
Node.jsNode.js
Node.js
 
Node.js: A Guided Tour
Node.js: A Guided TourNode.js: A Guided Tour
Node.js: A Guided Tour
 
Nodejs presentation
Nodejs presentationNodejs presentation
Nodejs presentation
 
Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS
 
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdfNode.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
 
An overview of node.js
An overview of node.jsAn overview of node.js
An overview of node.js
 
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 for beginners
Node js for beginnersNode js for beginners
Node js for beginners
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
node.js
node.jsnode.js
node.js
 
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
 
Proposal
ProposalProposal
Proposal
 
NodeJS
NodeJSNodeJS
NodeJS
 
Node js presentation
Node js presentationNode js presentation
Node js presentation
 

Kürzlich hochgeladen

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Kürzlich hochgeladen (20)

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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

Node.js

  • 1. Node.js HP.com Brown Bag Session 15 Feb 2012 Alif
  • 2. What?! Server-side javascript Built on top of Chrome V8 – insanely fast, and getting better every day http://code.google.com/p/v8/ C: node server.js
  • 3. Some facts.. Not a web framework.. Non blocking I/O – event loop Not written in javascript itself. It’s in C. Javascript is only, Function Object Number String Array Wasn’t designed for TCP / network stuff by nature
  • 4. Why Node's goal is to provide an easy way to build scalable network programs.
  • 5. How Keep slow operations from blocking other operations.
  • 6. Traditional I/O var data = file.read('file.txt'); doSomethingWith(data); Something is not right here
  • 7. FAIL ! var data = file.read('file.txt'); // zzzZZzzz … …. … . . . doSomethingWith(data); Don’t waste those cycles!
  • 8. Async I/O file.read('file.txt', function(data) { doSomethingWith(data); }); doSomethingElse(); WIN ! No need to wait for the disk, do something else meanwhile!
  • 9. Seriously, why javascript though :/ De facto standard language for web programming do not underestimate javascript, https://github.com/languages
  • 10. Nodejs is… - Immature - Not yet proven at large scale code size Interesting reading: http://teddziuba.com/2011/10/node-js-is-cancer.html it's opaque and weird to most but completely usable for a small group
  • 11. Best use for.. JSON APIs – heavy ajax call consumption Streaming data – parsing file uploads in real time Soft Realtime Applications – chat/IM, twitter, realtime scoreboards
  • 12. Who use it Real world app, https://github.com/joyent/node/wiki/Projects,- Applications,-and-Companies-Using-Node .. growing rapidly each days
  • 13. The beauty of Node is that you can write entirely simple and mundane JavaScript to get these results.
  • 14. Node Modules NPM – Node package manager http://search.npmjs.org/ C: npm install express jade stylus Or, define it in package.json format, Then just hit npm install
  • 15. { live demo session } Stalk here for more gossips: http://nodejs.org http://howtonode.org