Node js overview

949 views

Published on

Node js overview

0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
949
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
43
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Node js overview

  1. 1. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
  2. 2. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com “Everything that can be written in JavaScript will eventually be written in JavaScript”. (Atwood’s law)
  3. 3. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com© 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
  4. 4. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
  5. 5. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
  6. 6. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com© 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
  7. 7. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
  8. 8. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com© 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
  9. 9. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
  10. 10. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com© 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
  11. 11. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com Google JavaScript engine A high performance, cross-platform evented I/O library
  12. 12. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
  13. 13. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com (source: Future-proofing Your Apps: Cloud Foundry and Node.js)
  14. 14. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com(source: Future-proofing Your Apps: Cloud Foundry and Node.js)
  15. 15. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com(source: Future-proofing Your Apps: Cloud Foundry and Node.js)
  16. 16. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
  17. 17. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com© 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com Objects:  global  process  Console  module  exports functions:  Buffer  require()  setTimeout(cb,ms) , clearTimeout(t)  setInterval(cb,ms) , clearInterval(t)
  18. 18. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
  19. 19. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com© 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com var circle = require('./circle.js'); console.log('The area of radius 4: '+ circle.area(4)); foo.js var PI = Math.PI; exports.area = function (r) {return PI * r * r;}; exports.circumference = function (r) {return 2 * PI * r;}; circle.js The variable PI is private to circle.js exports === module.exports
  20. 20. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com© 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
  21. 21. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com console.log('a starting'); exports.done = false; var b = require('./b.js'); console.log('in a,b.done= %j', b.done); exports.done = true; console.log('a done'); console.log('b starting'); exports.done = false; var a = require('./a.js'); console.log('in b,a.done= %j', a.done); exports.done = true; console.log('b done'); console.log('main starting'); var a = require('./a.js'); var b = require('./b.js'); console.log('in main, a.done=%j, b.done=%j', a.done, b.done); b.jsa.js main.js b.js tries to load a.js. In order to prevent an infinite loop an unfinished copy of the a.js exports object is returned to the b.js module. main starting a starting b starting in b, a.done = false b done in a, b.done = true a done in main, a.done=true, b.done=true Output
  22. 22. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com© 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com  https  Net  Os  Path  Punycode  Querystring  Readline  Repl  string_decoder  Tls  Tty  url  Util  Vm  zlib
  23. 23. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com© 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
  24. 24. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com© 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
  25. 25. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com© 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
  26. 26. © 2014 All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com

×