date.coffee
 1  options = require('../lib/dreamopt') [
 2    "  -f, --from DATE  Only process records from the given date #date"
 3  ], {
 4    date: (value, options, optionName) ->
 5      if isNaN(new Date(value))
 6        throw new Error("Invalid date for option #{optionName}")
 7      new Date(value)
 8  }
 9  
10  console.log "Year: " + options.from?.getFullYear()