Skip to content

Instantly share code, notes, and snippets.

@lvivier
Last active August 29, 2015 14:17
Show Gist options
  • Save lvivier/957577054a37ddff8b47 to your computer and use it in GitHub Desktop.
Save lvivier/957577054a37ddff8b47 to your computer and use it in GitHub Desktop.
node.js intro notes for Lighthouse Labs

node intro

Some node stuff for Lighthouse Labs.

big ideas

  • javascript everywhere
  • modules
  • callbacks
  • events
  • async i/o & event loop
  • streams

links

deck comments

npm tips

# adds to your package.json
$ npm install --save <module>
# adds to your package.json devDependencies
$ npm install --save-dev <module>
# too lazy to type install?
$ npm i <module>

Using npm run instead of Make, Rake, or gulp: substack

node gotchas

  • don't write code, use npm
  • don't starve the main thread
  • if you have expensive CPU operations, use process.nextTick
  • use node-inspector
  • use nodemon
  • pin versions in package.json
  • avoid cluster for scaling: spawn many processes and load balance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment