code: function doOnce(fn) {
      var called = false;
      return function() {
        if (called) throw new Error("Callback already called.");
        called = true;
        fn.apply(root, arguments);
      };
    }
docs: https://github.com/caolan/async