         timeLog "compiled #{source}"
   path.exists jsDir, (exists) ->
     if exists then compile() else exec "mkdir -p #{jsDir}", compile
+    
+# Convenience for cleaner setTimeouts.
+wait = (milliseconds, func) -> setTimeout func, milliseconds
 
 # When watching scripts, it's useful to log changes with the timestamp.
 timeLog = (message) ->

        compile()
      else if event is 'rename'
        watcher.close()
        setTimeout ->
          compile()
          try
            watcher = fs.watch source, callback
          catch e then watchErr e
        , 250
  catch e then watchErr e


# Watch a directory of files for new additions.


  compile = ->
    clearTimeout compileTimeout
    compileTimeout = wait 25, ->
      fs.stat source, (err, stats) ->
        return watchErr err if err
        return if prevStats and (stats.size is prevStats.size and
