Skip to content

Instantly share code, notes, and snippets.

@gnomeontherun
Created October 25, 2012 21:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gnomeontherun/3955552 to your computer and use it in GitHub Desktop.
Save gnomeontherun/3955552 to your computer and use it in GitHub Desktop.
Notes about Node.js as I learn

Day 2

  • npm install package --save will auto add to dependencies
  • Use an MVC structure
  • You can have dependencies just for development
  • There are a few higher level frameworks (Tower.js, Geddy, Derby, Locomotive.js) but it seems wise to keep it simple
  • Use an MVC structure
  • The power of node modules cannot be understated. On the other hand it seems best to limit as much as possible to only required modules
  • Get your code clearly organized from the start
  • Use an MVC structure
  • On OSX, make sure you have xcode command line tools installed (appears to have left my machine during software upgrade or something)

Day 1

  • Run node-dev while testing an application node-dev app.js
  • Express is cool
  • Install express globally npm install -g express and you probably have to run that with sudo
  • Jade is a terrible template engine
  • Setup an express template express -e ejs
  • Start simple, abstract your code later to reduce callback hell
  • Add dependencies to your package.json file, its an object like "dependencies": { "express":"*" }
  • After adding dependencies and saving the package.json file, run npm install to set up the modules
  • The NPM search is lame, it uses Google
  • The node.js api docs might make more sense after a while, best to google general questions and use docs for specific details of a package

Day 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment