Introduction to Node.JS      By Derek Anderson
I CAN HASSERVER-SIDE !!?
What is Node.JS?Evented I/O for V8 JavaScript
What is Node.JS?Evented I/O for V8 JavaScript
What is Node.JS?Evented I/O for V8 JavaScript
Why?Nodes goal is to provide an easy wayto build scalable network programs.                               - nodejs.org
Traditional I/Ovar data = fs.readFile(large.mov);// Wait until file.read finishesdoSomethingWith(data);Waiting for disk oper...
Asynchronous I/Ofs.readFile(large.mov, function(data){  doSomethingWith(data);});// Do Something Else Right Away!doSomethi...
THE GOOD• JavaScript on the Server
THE GOOD• JavaScript on the Server• Desktop / Web / CLI Applications
THE GOOD• JavaScript on the Server• Desktop / Web / CLI Applications• Non Blocking I/O: DB, Filesystems, etc
THE GOOD• JavaScript on the Server• Write CLI / GUI Applications• Non Blocking I/O: DB, Filesystems, etc• NPM : Node Packa...
THE GOOD• JavaScript on the Server• Write CLI / GUI Applications• Non Blocking I/O: DB, Filesystems, etc• NPM : Node Packa...
Getting Started
Installation            Compile from Sourcehttps://github.com/joyent/node/wiki/Installation                 Install NPM  $...
Hello World                                    /hello-world.js      console.log(Hello World);$ node hello-world.js Hello W...
Core Modules• HTTP/HTTPS - Rock on!
Core Modules• HTTP/HTTPS - Rock on!• TCP - That’s nifty...
Core Modules• HTTP/HTTPS - Rock on!• TCP - That’s nifty...• DNS - Perform DNS operations
Core Modules• HTTP/HTTPS - Rock on!• TCP - That’s nifty...• DNS - Perform DNS operations• Filesystems - read/write/watch !!
Core Modules• HTTP/HTTPS - Rock on!• TCP - That’s nifty...• DNS - Perform DNS operations• Filesystems - read/write/watch !...
Core Modules     • HTTP/HTTPS - Rock on!     • TCP - That’s nifty...     • DNS - Perform DNS operations     • Filesystems ...
Modulesvar fs = require(fs),  sys = require(sys),  http = require(http),  foo = require(./lib/foo),  bar = require(./lib/b...
Roll Your Own Modules                                        lib/say.js   exports.say = function(something){     return so...
HTTP ServerIf you want to make an HTTP Server,you must first create the universe.                          - Carl Sagan
HTTP Server                                                        /hello-http.jsvar http = require(http)http.createServer...
HTTP Server
Resources & Tutorials
Resources & Tutorials  List of Resources from Joyent   https://github.com/joyent/node/wiki/Resources    Node.js Beginners ...
DEMO TIME
Questions                            ?http://github.com/mediaupstreamemail: derek@mediaupstream.com            twitter: @d...
Upcoming SlideShare
Loading in …5
×

Introduction to NodeJS with LOLCats

2,447 views

Published on

Talk given at Javascript.MN meetup 8/25/2011 by Derek Anderson.

A basic overview of NodeJS (Yet Another NodeJS Intro) ... All anyone knows is the basics it seems ;-)

I talk about Node, show some LOLCats, demo a LOLChat (lolcat translation realtime chat app: https://github.com/mediaupstream/LOLChat)
and a realtime drawing app: (http://draw.mediaupstream.com)

HUZZAH!

Published in: Technology
2 Comments
2 Likes
Statistics
Notes
  • Great presentation Derek, I am also working on something with NodeJS. A good read...
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Talk given at Javascript.MN meetup 8/25/2011.

    A basic overview of NodeJS (Yet Another NodeJS Intro) ... All anyone knows is the basics it seems ;-)

    I talk about Node, show some LOLCats, demo a LOLChat (lolcat translation realtime chat app: https://github.com/mediaupstream/LOLChat)
    and a realtime drawing app: (http://draw.mediaupstream.com)

    HUZZAH!
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
2,447
On SlideShare
0
From Embeds
0
Number of Embeds
14
Actions
Shares
0
Downloads
59
Comments
2
Likes
2
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Introduction to NodeJS with LOLCats

    1. 1. Introduction to Node.JS By Derek Anderson
    2. 2. I CAN HASSERVER-SIDE !!?
    3. 3. What is Node.JS?Evented I/O for V8 JavaScript
    4. 4. What is Node.JS?Evented I/O for V8 JavaScript
    5. 5. What is Node.JS?Evented I/O for V8 JavaScript
    6. 6. Why?Nodes goal is to provide an easy wayto build scalable network programs. - nodejs.org
    7. 7. Traditional I/Ovar data = fs.readFile(large.mov);// Wait until file.read finishesdoSomethingWith(data);Waiting for disk operation to finish is slow!
    8. 8. Asynchronous I/Ofs.readFile(large.mov, function(data){ doSomethingWith(data);});// Do Something Else Right Away!doSomethingElse();Read from the disk, and fire a callback when done. Meanwhile, Do Something Else! Inspiration: Felix Geisendörfer
    9. 9. THE GOOD• JavaScript on the Server
    10. 10. THE GOOD• JavaScript on the Server• Desktop / Web / CLI Applications
    11. 11. THE GOOD• JavaScript on the Server• Desktop / Web / CLI Applications• Non Blocking I/O: DB, Filesystems, etc
    12. 12. THE GOOD• JavaScript on the Server• Write CLI / GUI Applications• Non Blocking I/O: DB, Filesystems, etc• NPM : Node Package Manager
    13. 13. THE GOOD• JavaScript on the Server• Write CLI / GUI Applications• Non Blocking I/O: DB, Filesystems, etc• NPM : Node Package Manager• Active and friendly Community
    14. 14. Getting Started
    15. 15. Installation Compile from Sourcehttps://github.com/joyent/node/wiki/Installation Install NPM $ curl http://npmjs.org/install.sh | sh
    16. 16. Hello World /hello-world.js console.log(Hello World);$ node hello-world.js Hello World
    17. 17. Core Modules• HTTP/HTTPS - Rock on!
    18. 18. Core Modules• HTTP/HTTPS - Rock on!• TCP - That’s nifty...
    19. 19. Core Modules• HTTP/HTTPS - Rock on!• TCP - That’s nifty...• DNS - Perform DNS operations
    20. 20. Core Modules• HTTP/HTTPS - Rock on!• TCP - That’s nifty...• DNS - Perform DNS operations• Filesystems - read/write/watch !!
    21. 21. Core Modules• HTTP/HTTPS - Rock on!• TCP - That’s nifty...• DNS - Perform DNS operations• Filesystems - read/write/watch !!• Crypto, SSL/TLS, Readline, etc...
    22. 22. Core Modules • HTTP/HTTPS - Rock on! • TCP - That’s nifty... • DNS - Perform DNS operations • Filesystems - read/write/watch !! • Crypto, SSL/TLS, Readline, etc...Over 3,400 Community Modules and counting ! http://search.npmjs.org/
    23. 23. Modulesvar fs = require(fs), sys = require(sys), http = require(http), foo = require(./lib/foo), bar = require(./lib/bar);Import system wide modules such as fs,sys, http or local modules like /lib/foo.js
    24. 24. Roll Your Own Modules lib/say.js exports.say = function(something){ return something; } server.js var baz = require(./lib/say); console.log(baz.say(Foo Bar!)); $ node server.js Foo Bar!
    25. 25. HTTP ServerIf you want to make an HTTP Server,you must first create the universe. - Carl Sagan
    26. 26. HTTP Server /hello-http.jsvar http = require(http)http.createServer(function(req, res){ res.writeHead(200, {Content-Type: text/plain}); res.end(Hello World!);}).listen(3000);console.log(Hello World); $ node hello-http.js Server Running
    27. 27. HTTP Server
    28. 28. Resources & Tutorials
    29. 29. Resources & Tutorials List of Resources from Joyent https://github.com/joyent/node/wiki/Resources Node.js Beginners Guide http://nodeguide.com/beginner.html Read the API http://nodejs.org/docs/latest/api/
    30. 30. DEMO TIME
    31. 31. Questions ?http://github.com/mediaupstreamemail: derek@mediaupstream.com twitter: @derekanderson

    ×