Successfully reported this slideshow.
Your SlideShare is downloading. ×

Getting started with developing Nodejs

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Upcoming SlideShare
Nodejs in Production
Nodejs in Production
Loading in …3
×

Check these out next

1 of 124 Ad

Getting started with developing Nodejs

Download to read offline

An introduction to developing with Node.js and some useful tools to help the development and deployment processes. This talk was given at Asyncjs in Brighton

http://asyncjs.com/intro-nodejs

An introduction to developing with Node.js and some useful tools to help the development and deployment processes. This talk was given at Asyncjs in Brighton

http://asyncjs.com/intro-nodejs

Advertisement
Advertisement

More Related Content

Slideshows for you (20)

Viewers also liked (20)

Advertisement

Similar to Getting started with developing Nodejs (20)

Recently uploaded (20)

Advertisement

Getting started with developing Nodejs

  1. 1. yet another talk on node.js getting started @philhawksworth
  2. 2. what we’ll look at whaddizit? installation options hello world modules & frameworks deploying & hosting comet and beyond
  3. 3. assumptions web development experience javascript knowledge unix, linux, osx not a nodejs ninja
  4. 4. whaddizit?
  5. 5. Evented I/O for V8 Javascript
  6. 6. evented i-what now? c++ v8 javascript engine server-side javascript single event loop non-blocking
  7. 7. useful knowledge strong javascript jQuery patterns
  8. 8. dangerous knowledge jQuery patterns
  9. 9. considerations how mature is it? v0.0.1: early 2009, currently v.0.4.8 who uses it? everyone is playing.
  10. 10. 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.
  11. 11. ball-ache: stability rate of change
  12. 12. installation options build from source package ndistro n
  13. 13. from source clone source from github install dependancies xcode tools configure, make, make install
  14. 14. package
  15. 15. ball-ache: stability rate of change
  16. 16. many versions many versions many versions ndistro & n
  17. 17. ndistro node distribution toolkit
  18. 18. enables many versions of node
  19. 19. http://github.com/visionmedia/ndistro
  20. 20. http://github.com/visionmedia/ndistro
  21. 21. local versions for each project
  22. 22. n
  23. 23. install as a module
  24. 24. ball-ache version stability module stability
  25. 25. installing modules npm node package manager
  26. 26. curl http://npmjs.org/install.sh | sh
  27. 27. $ npm install <package>
  28. 28. $ npm install n
  29. 29. $ npm install n@0.4.1
  30. 30. $ npm ls
  31. 31. !"# 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
  32. 32. !"# 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
  33. 33. $ npm update n
  34. 34. $ npm install n
  35. 35. $ npm update npm
  36. 36. n
  37. 37. while ndistro is for virtual environments
  38. 38. while ndistro is for local environments
  39. 39. n gives system wide node versioning
  40. 40. $ n 0.2.6 $ n v0.3.3
  41. 41. download configure make install
  42. 42. $ n ls
  43. 43. $ n
  44. 44. 0.2.3 0.2.6 --debug 0.3.4 0.3.5 ο 0.4.8
  45. 45. $ n use 0.4.8
  46. 46. what we’ll look at whaddizit? installation options hello world modules & frameworks deploying & hosting comet and beyond
  47. 47. hello world
  48. 48. app.js hello world
  49. 49. $ node app.js
  50. 50. $ ./bin/node app.js
  51. 51. $ n use 0.4.8 app.js
  52. 52. frameworks get a little help uri routing content negotiation templating environment configuration
  53. 53. express the canonical web development framework http://expressjs.com
  54. 54. templating many ways to render your response
  55. 55. bootstrapping quick scaffolding
  56. 56. $ express --template --css --session
  57. 57. $ n use 0.4.8 app.js
  58. 58. deploying where do I put this thing? self-managed amazon, linode, slicehost managed heroku, no.de
  59. 59. duostack automated, git-based deployment install via npm manage dependancies via npm limited versions of nodejs
  60. 60. server.js hello world
  61. 61. $ git init $ git add $ git commit -m ‘1st commit’
  62. 62. $ duostack create nodedemo $ git push duostack master
  63. 63. 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
  64. 64. self-managed amazon, linode, slicehost
  65. 65. deploying get it there git configure it install dependencies get it up, and keep it up upstart
  66. 66. $ git clone project.git $ cd project $ ndistro
  67. 67. ndistro is really just the shell
  68. 68. replicates your environment
  69. 69. keeping it up
  70. 70. $ /etc/init.d/
  71. 71. http://upstart.ubuntu.com/
  72. 72. what we’ll look at whaddizit? installation options hello world modules & frameworks deploying & hosting comet and beyond
  73. 73. easy comet requests websockets
  74. 74. comet long-lived http requests
  75. 75. javascript on the client asks, and listens asks again, or takes action
  76. 76. websockets more efficient low latency comms
  77. 77. supported in modern browsers
  78. 78. Graceful degradation
  79. 79. WebSocket Adobe Flash Socket Ajax long polling Ajax multipart streaming Forever Iframe JSONP Polling
  80. 80. but... node is not just for realtime
  81. 81. staying in the loop and finding out more
  82. 82. github wiki github.com/joyent/node/wiki
  83. 83. irc irc.freenode.net #node.js
  84. 84. github wiki
  85. 85. @ryah @tjholowaychuk @isaacs @sh1mmer
  86. 86. ta! hawksworx.com @philhawksworth

×