The evening program What is node.js? Why should you care? Because it’s the best around… How? (not even 10K can bring it down!) Corporate America has already caught on, so should you! Why JS ? Why now? Blocking|non-blocking I/O AKA event-driven programming. What? Google V8 JS Engine. VROOOOM VROOOM Modules Modules Modules MODULES Stylus = CSS like whoaaaa Coffeescript = JS like whoaaa Express Examples Pros|Cons Check in b4 u check out o/
node.JS – A ready-set-code server Changing the notion of server functionality Built to handle tens of thousands (& counting) connections SSJS atop Google’s open-source JS engine Written in C/C++ A PROBLEM SOLVER
Oh wuddya look at that!
It’s…It’s…It’s…It’s…It’s…IT’S It’s non-blocking (event-driven) It’s scalable It’s syntactically accessible It’s rich with resources It’s built upon a castle of code and machines (C++ and V8) It’s totalllyyyyy popular It’s about time
WHO’S USING IT?
The Biggest Programming Party, +8 It’s (1 of) the fastest-growing programming language(s) EVER Vibrant communities promote faster development and adoption More developers = more developments More developers working on an open-source project = more synergystic developments
Just Ryan in March 09’
Nov 09’ = thanksgitin’
Nov 10’ – Ryan’s made friends!
Ry & co. on the Ryse
Why JS & not something else? So many people already use it Anon functions. Local/global variables set very appropriate stage for event-driven programming It’s already in all of our applications Reuse code between your browser & server implementations The JS interpreters race (V8 WINNING)
Google Chrome V8 JS engine Written in C++ (+1) Open-source Fast property access Specifically designed for fast execution of large JS apps No intermediate byte codes, no interpreter (Dynamic Machine Code Generation) JIT compliing Efficient Garbage collection
The Internet: A single slide history 91’-99: THE HTML AGE : static, hand-coded crudely designed document files served to static clients. 00’-09’: THE LAMP AGE: databases replaced documents, solution stacks saturated the market. 10’-x’: THE JS AGE: dynamic web-apps, interactive information garnishing media-rich foundations
Really Though, Why? “it doesn’t do anything that current technology can’t do…” WRONG SIR WRONG! “if you wanna node, you gotta write all your own code…” WRONG SIR WRONG! “it’s just another one of those darn kids doing something crazy. It’ll die out soon…” WRONG SIR WRONG! “it makes no sense to use for large businesses since it’s non-standardized, nor is it tried and true…” RIGHT SIR NOW, WRONG SIR LATER! “everything works just fine now, and changing things will just complicate everything for no reason…” WRONG SIR WRONG!
An event-driven request in 5 steps request “/about.html” from your browser on a Node.js web server. Server accepts request &calls a function to retrieve that file from disk. While the server is waiting for the file to be retrieved, it services the next web request. When the file is retrieved, there is a callback function that is inserted in the Node servers queue. Node server executes that function (renders the “/about.html”) & sends it to your web browser.
MODULE MADDNESS! Boosts Productivity & Totally Inspires “Write Less. Do More” –jQuery Comes shipped with core modules An endless library of 3rd party mechanisms of all kinds NPM (node package managers) to ensure a smooth ride
Some Cool Core Modules Networking: net: create TCP server | client; http: create HTTP server or client Event Emitter: gives objects the ability to emit events (duh) Buffer: create buffers to transport binary data Streams: abstract interface implemented by various objects
3rd Party Modules: the preview face.Js : face-dectection in images w/OpenCV Node-wkhtml: html to pdf or image format using the webkit rendering engine, and qt. Node-boilerplate: takes html-boilerplate, express, connect and Socket.IO and organizes them into a ready to use website project. Coffeekup = make EVERYTHING coffeescript static file servers = Lightnode, nitrode, trailer (everyone’s favorite backend), node-paperboy
KEY + EXAMPLES
THE EXISTENTIAL OPERATOR
ENGLISH! === !== ! && || true false this in n/a is isnt not and Or True, yes, on False, no, off @, this Of In
It’S JUST BEGUN-A-brewin’…!
COFFEESCRIPT MODULES Coffeekup: markup as CS Coffeemate: framework for writing apps in CS Unifies programming Makes work even easier
Express: Pretty dope node web framework node.JS “Hello World” server Express “Hello World” server
The Final + & - minus of it all Makes coding more intuitive (syntactically & technically) Developers are passionately clinkering away on improvements all day, every day Takes progressive strides in what many believe is the right direction Haters gonna hate Learning Curves Doesn’t try to be compatible with pre-existing software Updates make current projects liable to be incompatible with new releases
Are We Done Yet? Can you give a cocktail party version of what node.JSis? Are you going to go home and check it out? Are you convinced? Are you envisioning a grand design with node as a backbone yet?
BEFORE YOU GO… Hey…I just wanna let you know I had a great time tonight and hope we could, ya know, maybe meetupagain maybe and build a scalable server or something, or we could just build a static web page, whatever, totally up to you.