How would one make a nodejs application wait for async calls to finish?
main.coffee:
hosts = require './suhosts'
dns = require 'dns'
async = require 'async'
data = {}
async.each hosts, (host, cb_e) ->
   dns.lookup host,  (err, address, family)-> data[host] = address
 , () ->
   console.log data
if one runs this like coffee main.coffee it will exit before doing the work. 
 
     
    