Skip to content

Instantly share code, notes, and snippets.

@cjlyth
Created March 26, 2014 02:42
Show Gist options
  • Save cjlyth/9776001 to your computer and use it in GitHub Desktop.
Save cjlyth/9776001 to your computer and use it in GitHub Desktop.
# ****
# Needs to be before the optional dependency
# ****
optional = (name) ->
try
require name
catch err
console.log " * optional dependency not found: #{name}"
false
# !!! include optional.coffee somehow !!!!
path = require 'path'
open = optional 'open'
lodash = optional 'lodash'
url = 'http://localhost:3000/'
open url if open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment