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

Node.js: Server of Many Uses

Node.js: Server of Many Uses

An incomplete tour of just a few of the awesome unconventional (for a web stack) things people are doing with node.js. Presented at the Colorado Springs Open Source Users Group Feb 23, 2012

Mike Brevoort

March 06, 2012
Tweet

More Decks by Mike Brevoort

Other Decks in Programming

Transcript

  1. Mike Brevoort @mbrevoort work at... (though opinions expressed in this

    presentation are my own and not meant to represent Pearson) 2
  2. agenda very brief intro to node.js a tour of some

    “unconventional” uses of node.js * though I don’t particularly like the work conventional 3
  3. “Most languages were designed to solve computational problems, but Node.js

    is different. Node.js was designed from the ground up to efficiently handle the communication that is at the heart of modern web applications.” http://www.joyentcloud.com/products/smart-appliances/ node-js-smartmachine/ 5
  4. “Mozilla uses a single node thread to simulate 180K users!

    I have commercial testing gear that can't do that! #nodesummit” Chris Johnson @mast3rof0 - 1/24/2012 7
  5. 9

  6. DNode symmetric remote function calling between processes to/from the browser

    via socket.io JSON protocol dnode ports in ruby, java, php, perl https://github.com/substack/dnode async rpc through sockets/JSON 11
  7. zombie.js fast headless simulated browser testing Cookies and Web Storage

    XMLHttpRequest in all its glory setTimeout/ setInterval pushState, popstate and hashchange events alert, confirm and prompt HTML5 parsing and dealing with tag soups DOM Level 3 implementation HTML5 form fields (search, url, etc) CSS3 Selectors with some extensions 15
  8. headless WebKit with JavaScript API Fast and native NOT node.js

    But node is commonly used as an orchestrator 16
  9. 21

  10. 22

  11. node-canvas https://github.com/LearnBoost/node-canvas HTML5 server-side canvas API fallback run canvas API

    calls in node, send an image back to the client great for some mobile use cases legacy browser fallback 24
  12. https://github.com/substack/propagit multi-server git deployment over http Propagit Hub drone drone

    drone drone git push http://hubhost:6001/ somerepo master repos/somerepo.git repos/somerepo.git repos/somerepo.git repos/somerepo.git 26
  13. Propagit https://github.com/substack/propagit multi-server git deployment over http Hub drone drone

    drone drone propagit deploy --hub=hubhost:6000 --secret=beepboop \ somerepo ed56c6e85731d412fe22cf437cb63130afc34b07 deploy/ somerepo.ed56c... deploy/ somerepo.ed56c... deploy/ somerepo.ed56c... deploy/ somerepo.ed56c... 27
  14. Propagit https://github.com/substack/propagit multi-server git deployment over http Hub drone drone

    drone drone propagit spawn --hub=hubhost:6000 --secret=beepboop \ somerepo ed56c6e85731d412fe22cf437cb63130afc34b07 \ -- node server.js 8085 deploy/ somerepo.ed56c... deploy/ somerepo.ed56c... deploy/ somerepo.ed56c... deploy/ somerepo.ed56c... 28
  15. node_pcap decode, print and analyze packets node makes it very

    nice since each packet is emitted as a Buffer by the EventEmitter libpcap bindings https://github.com/mranney/node_pcap 33
  16. shell scripting fs core library - abstract OS or shell

    implementation details can leverage the node module ecosystem great if you need to do I/O beyond filesystem npm client 35
  17. Browser fallbacks Deployment Load balancing Network tracing Shell scripting Load

    generation IPC Testing Screenshotting Webcrawling tip of the iceberg 38