New Kid On The Block – Node.jsJoel DivekarGM – Information Systems,People Interactive (I) Pvt. Ltd.Open Source Conference,...
Node.js was developed by Ryan Dhal in 2009   and the project is managed by Joyent
Node.js is ...Server side JavaScript    Event Driven  Asynchronous I/O  Single Threaded    Lightweight
Node.js ...High performance network application framework and caneasily handle thousands of concurrent connections withmin...
Node.js is similar to ...EventMachine in RubyTwisted in Python
I/OBlocking I/Ovar fs = require(fs);var file1 = fs.readFileSync(File1.txt, utf­8);console.log(“Reading File1.txt”);var fil...
I/OBlocking I/OReading File1.txt took 10 msReading File2.txt took 6 msTotal time 16 msNon-Blocking I/OReading File1.txt to...
Callback//callback after 2 secondssetTimeout(function(){    console.log(“World”);}, 2000);    console.log(“Hello”);
Node REPLREPL : Read - Eval - Print - Loop$ node> a=[1,2,"3",four,];[ 1, 2, 3, four ]> a.forEach(function (v) {... console...
Node.js HTTP Servervar http = require("http");http.createServer(function(req, res) {req.on("end", function () {res.writeHe...
Node.js HTTP Servervar http = require("http");http.createServer(function(req, res) {req.on("end", function () {res.writeHe...
npmnpm is package manager for node.js, similar to RubyGems &  Python easy_installnpm install <module_name>ModulesExpress –...
Who is using Node.js ...
Thanks a lot for your time …    joel.divekar@gmail.com www.linkedin.com/in/joeldivekar   joeldivekar.blogspot.com www.slid...
Upcoming SlideShare
Loading in …5
×

New kid on the block node.js

2,547 views

Published on

This presentation was presented by at ‘Open source Conference’, Pune, India organised by SiliconIndia on 23rd March 2013.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,547
On SlideShare
0
From Embeds
0
Number of Embeds
41
Actions
Shares
0
Downloads
19
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

New kid on the block node.js

  1. 1. New Kid On The Block – Node.jsJoel DivekarGM – Information Systems,People Interactive (I) Pvt. Ltd.Open Source Conference, Pune23rd March, 2013
  2. 2. Node.js was developed by Ryan Dhal in 2009 and the project is managed by Joyent
  3. 3. Node.js is ...Server side JavaScript Event Driven Asynchronous I/O Single Threaded Lightweight
  4. 4. Node.js ...High performance network application framework and caneasily handle thousands of concurrent connections withminimum CPU / Memory UtilisationBuilt on top of Googles V8 JavaScript engine used inChromeEasy to build scalable network servers
  5. 5. Node.js is similar to ...EventMachine in RubyTwisted in Python
  6. 6. I/OBlocking I/Ovar fs = require(fs);var file1 = fs.readFileSync(File1.txt, utf­8);console.log(“Reading File1.txt”);var file2 = readFileSync(File2.txt, utf­8);console.log(“Reading File2.txt”);Non-Blocking I/Ovar fs = require(fs);fs.readFileSync(File1.txt, utf­8, function(err,data){    console.log(“Reading File1.txt”)});fs.readFileSync(File2.txt, utf­8, function(err,data){    console.log(“Reading File2.txt”)});
  7. 7. I/OBlocking I/OReading File1.txt took 10 msReading File2.txt took 6 msTotal time 16 msNon-Blocking I/OReading File1.txt took 10 msReading File2.txt took 6 msTotal time 10 ms
  8. 8. Callback//callback after 2 secondssetTimeout(function(){    console.log(“World”);}, 2000);    console.log(“Hello”);
  9. 9. Node REPLREPL : Read - Eval - Print - Loop$ node> a=[1,2,"3",four,];[ 1, 2, 3, four ]> a.forEach(function (v) {... console.log(v);... });123fourUndefined> .exit
  10. 10. Node.js HTTP Servervar http = require("http");http.createServer(function(req, res) {req.on("end", function () {res.writeHead(200, {Content­Type : text/plain});res.end(Your IP is  + (req.headers[x­forwarded­for] ||  req.connection.remoteAddress) + !) });}).listen(8080);console.log("Server accepting request on http://127.0.0.1:8080");
  11. 11. Node.js HTTP Servervar http = require("http");http.createServer(function(req, res) {req.on("end", function () {res.writeHead(200, {Content­Type : text/plain});res.end(Your IP is  + (req.headers[x­forwarded­for] ||  req.connection.remoteAddress) + !) });}).listen(8080);console.log("Server accepting request on http://127.0.0.1:8080");
  12. 12. npmnpm is package manager for node.js, similar to RubyGems & Python easy_installnpm install <module_name>ModulesExpress – MVC frameworkSocket.IO – Websocket Library
  13. 13. Who is using Node.js ...
  14. 14. Thanks a lot for your time … joel.divekar@gmail.com www.linkedin.com/in/joeldivekar joeldivekar.blogspot.com www.slideshare.net/JoelDivekar

×