code: function loadHookFile(hookfile, hooks) {
    try {
      proxyquire(hookfile, { hooks });
    } catch (error) {
      logger.warn(`Skipping hook loading. Error reading hook file '${hookfile}'. `
        + 'This probably means one or more of your hook files are invalid.\n'
        + `Message: ${error.message}\n`
        + `Stack: \n${error.stack}\n`);
    }
  }
docs: The 'addHooks()' function is a strange glue code responsible for various side effects needed as a preparation for loading Node.js hooks. It is asynchronous only because as the last thing, it spawns the hooks handler process if it figures out the hooks are not JavaScript hooks.  In the future we should get rid of this code. Hooks should get a nice, separate logical component, which takes care of their loading and running regardless the language used, and either delegates to the hooks handler or not. Side effects should get eliminated as much as possible in favor of decoupling.