docs: function load (resources, callback) {
    var results = {}
    var errors = {}
    var hadErrors = false
  
    // TODO: use `async` module instead?
    var loadedResources = 0
    var resourceNames = Object.keys(resources)
    var numResources = resourceNames.length
  
    function onFinish () {
      try {
        if (hadErrors) {
          callback(errors, null)
        } else {
          callback(null, results)
        }
      } catch (e) {
        console.log(e)
        console.log(e.stack)
      }
    }
  
    resourceNames.forEach(function (name) {
      function onLoaded (err, data) {
        if (err) {
          hadErrors = true
          errors[name] = err
        } else {
          results[name] = data
        }
  
        if (++loadedResources === numResources) {
          onFinish()
        }
      }
  
      var res = resources[name]
      if (res.image) {
        loadImage(res.image, onLoaded)
      } else if (res.text) {
        loadText(res.text, onLoaded)
      } else if (res.json) {
        loadJSON(res.json, onLoaded)
      } else if (res.binary) {
        loadBinary(res.binary, onLoaded)
      } else {
        onLoaded(new Error('pex-io/load unknown resource type ' + Object.keys(res)), null)
      }
    })
  
    if (resourceNames.length === 0) {
      onFinish()
    }
  }