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

Introduction to NodeJs

Introduction to NodeJs

High level overview of what NodeJs is and how it can do cool things.

Anthony Pipkin

July 24, 2014
Tweet

More Decks by Anthony Pipkin

Other Decks in Technology

Transcript

  1. What about help? nodejs.org docs #node.js on Freenode IRC StackOverflow

    General searching for javascript, node.js, or npm
  2. According to Node Node's goal is to provide an easy

    way to build scalable network programs
  3. According to me NodeJs is a super awesome tool that

    allows me to take over the world.
  4. But seriously... JavaScript ECMAScript 5 No ugly DOM! Built on

    top of V8 Single threaded Asynchronous, non-blocking I/O Windows, Mac, Linux
  5. Step 2a JavaScript the Good Parts - Douglas Crockford http://livestre.am/JC3U

    or http://amzn.com/B002AWX8BO Eloquent JavaScript - Marijn Haverbeke http://eloquentjavascript.net/ JavaScript Design Patterns - Addy Osmani http://addyosmani.com/resources/essentialjsdesignpatterns/book
  6. Promises Relatively new to JavaScript promisejs.org npm packages q promised-io

    deferred promise.then(successFn, errorFn, progressFn)
  7. Callbacks `(err, data)` pattern `.bind` to maintain scope ( )

    maintains variables where defined http://www.digital-web.com/articles/scope_in_javascript/ More on JavaScript patterns in the online book(s).
  8. Building Packages npm init package.json configuration for node module dependency

    information command line load point (`bin`) npm install module npm install module --save Saved in ./node_modules/
  9. Command Line which node HashBang (#!) path +x the js

    file to it's executable make it installable via npm
  10. Web Server & Apps http clusters, PM2 ExpressJs, HapiJs, Restify

    Socket.io ( ) nodemon database MongoDb MySQL Postgres http://caniuse.com/websockets
  11. Don't Use Node for... Number Crunching (IEEE 754 "Double") 0.1

    + 0.2 === 0.3 // false Synchronous I/O calls Shell Scripting * Making toast ? ( ) http://youtu.be/MqHDDtVYJRI http://survivejs.com/current_state/might_run_on_toaster.html