##Day 2 - Building Up Strong
###10am - 10:50am : Recap from Day 1
- Recap
- JavaScript, node, npm, modules,
- Gel some ideas together, including how npm includes 3rd party modules
- Problem: Refactor code to resize images into separate module and separate repo in github. Update app to include it via package.json via tarball link
###10 min break
###11:00am - 11:30am : Running our Apps and Associated Tasks
- npm [script]
- make (posix only)
- npm home grunt
- npm home gulp
- ... Node.js scripts!
- Problem: Add a Makefile, create a 'start' target, and export environment variables needed to interact with github
- bonus: Add a gulpfile.js and task to minify your css and output to a build folder
###10 min break
###11:40pm - 12:15pm : Configuration
- config files
- npm home nconf
- npm home config-node
- environment variables
- process.env
- command line parameters
- npm home minimist
- Problem: Add a config.json file and configure your app to use it to pass in env vars required by passport-github
- bonus: Add ability to override config via command line arguments and/or environment variables
- Pro Tip: Best solution cascades between env-dependent config files, to environment variables, overidable by command options.
- Pro Tip: Flexibility of Makefile(s)
- allows multiple layers of compositing and overriding env vars
###12:15pm - 1:15pm : Lunch
- lunchtime tip:
- ES6 let operator and impact on variable scope
- ES6 generators and impact on async operations
###1:15pm - 2:00pm : Logging & Exception Handling
- npm home debug
- module specific logger names for within reusable modules
- debug, info, warn, error levels for within applications
- npm home node-inspector
- on('unhandleException', ....
- crash-first programming
- node --abort-on-uncaught-exception [script]
- cluster - http://nodejs.org/api/cluster.html
- https://github.com/sahat/hackathon-starter/blob/master/cluster_app.js
- npm home cluster-master
- npm home cluster-master-ext
- domains - http://nodejs.org/api/domain.html
- npm home express-domain-middleware
- npm home node-okay
- process managers: forever, upstart+monit
- Pro Tip: npm home bunyan
- Problems: Instrument your module with debug
- bonus: Wrap debug to create a logger for application level code allowing debug, info, warn, and error levels to be specified by environment variable
- bonus: Create a cluster.js and start your app with ncpus of workers.
- More Learning:
###10 min break
###2:10pm - 2:30pm: Code Analysis
- npm home jshint
- npm home jscs
- Problem: Add a linting task to your Makefile or npm scripts section, calling jshint and jscs, and fix the errors and warnings provided
- bonus: add a jshint and jscs step to your gruntfile.js
###10 min break
###2:40pm - 3:20pm: Testing
- npm home mocha (mention jasmine and others)
- npm home should
- npm home sinon
- Problem: Add a mocha test to your module that mocks out calls to 'gm', but ensures that the calls are made.
###10 min break
###3:30pm - 4:10pm: Standing on Shoulders and Bootstrapping
- hackathon-starter (https://github.com/sahat/hackathon-starter)
- npm home bower
- npm home yeoman
- Problem: User bower to install bootstrap and update your app to use it
###10 min break
###4:20 - 5:00pm: Node Style Modules on the Client and Code Reuse
- npm home browserify
- json rpc using:
- npm home dnode
- npm home shoe
- Problem: Add means of browserifying your client side code via bash in Makefile or npm scripts, or as a task in grunt or gulp.
- Bonus: Create a means of logging errors from the client to the server.
###10 min break
###(Stretch) 5:10 - 6:00pm: Functional Testing
- npm home selenium-webdriver
- Pro Tip: https://saucelabs.com/
###Day End Questions