Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Node.js - A practical Introduction

Node.js - A practical Introduction

Talk given at Big Tech Day 5 in Munich on 15.06.2012.

23968f0ca75b13463d2db5343e5c2096?s=128

Felix Geisendörfer

June 16, 2012
Tweet

Transcript

  1. A practical introduction 15.06.2012 - Big Tech Day 5, Munich

    Felix Geisendörfer
  2. Felix Geisendörfer

  3. transloadit.com

  4. core contributor

  5. npm modules

  6. node-formidable

  7. node-mysql

  8. ~50 modules total

  9. (@)felixge(.de)

  10. Audience

  11. Software Developers?

  12. JavaScript Developers?

  13. Heard about node.js?

  14. Using node.js?

  15. What is node.js?

  16. JavaScript on the Server

  17. Hello World

  18. 1 var http = require('http'); 2 3 http.createServer(function(req, res) {

    4 res.end('Hello World'); 5 }).listen(8080); hello world http server in node.js
  19. None
  20. None
  21. Features • TCP / UDP • HTTP / HTTPS •

    File System • Buffers (byte arrays) • DNS • Child Processes • Http / Https • Crypto • ZLIB • Readline / TTY / REPL
  22. < 5 min to install Windows, Mac, Linux

  23. History

  24. 1995 LiveWire released

  25. 1997 Rhino started

  26. ...

  27. Ryan Dahl starts the node project (first commit) Feb 16,

    2009
  28. I discovered node.js (v0.0.6) ~June, 2009

  29. Isaac Schlueter starts the npm package manager Sep 29, 2009

  30. Ryan’s talk at JSConf.EU gets people excited about node Nov

    7, 2009
  31. ...

  32. 2012

  33. None
  34. What is special?

  35. Non-blocking I/O

  36. var image = fs.readFileSync('some.jpeg'); console.log('hello'); vs fs.readFile('some.jpeg', function(err, image) {

    }); console.log('hello');
  37. Easy concurrency

  38. Low memory usage

  39. Good performance

  40. More on performance

  41. Google V8

  42. None
  43. JS -> Assembly

  44. Crankshaft JIT

  45. Fast

  46. Now in Munich

  47. Simple Benchmark

  48. 1 kb http responses ~6000 requests / second* * per

    CPU core
  49. Why JavaScript?

  50. // Today (15.06.2012) > (new Date).getMonth() 5

  51. > 0.3 + 0.3 + 0.3 0.8999999999999999

  52. None
  53. Everywhere

  54. War on JavaScript

  55. No I/O in Standard Lib

  56. Use Cases

  57. WebSockets

  58. Streaming

  59. Code Sharing

  60. etc.

  61. node package manager

  62. 10.000+ packages

  63. local installs

  64. None
  65. Join the Community • Mailing list (nodejs, nodejs-dev) • IRC

    (#node.js) - 700+ User online
  66. Thank you!

  67. Questions? ” http://felixge.de/ felix@debuggable.com @felixge

  68. Bonus: Live Coding