Your SlideShare is downloading. ×
0
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Getting started with developing Nodejs
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Getting started with developing Nodejs

5,798

Published on

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 …

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

Published in: Technology
2 Comments
6 Likes
Statistics
Notes
No Downloads
Views
Total Views
5,798
On Slideshare
0
From Embeds
0
Number of Embeds
69
Actions
Shares
0
Downloads
45
Comments
2
Likes
6
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

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

×