makeNodeBundleCache = async (
  dest,
  options,
  loadModule,
  pid,
  nonce,
) => {
  const [fs, path, url, crypto, timers, os] = await Promise.all([
    loadModule('fs'),
    loadModule('path'),
    loadModule('url'),
    loadModule('crypto'),
    loadModule('timers'),
    loadModule('os'),
  ]);

  if (nonce === undefined) {
    nonce = crypto.randomInt(0xffff_ffff);
  }

  const readPowers = {
    ...makeReadPowers({ fs, url, crypto }),
    delay: ms => new Promise(resolve => timers.setTimeout(resolve, ms)),
    basename: path.basename,
  };

  const cwd = makeFileReader('', { fs, path });
  await fs.promises.mkdir(dest, { recursive: true });
  const destWr = makeAtomicFileWriter(dest, { fs, path, os }, pid, nonce);
  return makeBundleCache(destWr, cwd, readPowers, options);
}
@param {string} dest
@param {{ format?: string, cacheOpts?: CacheOpts, cacheSourceMaps?: boolean, dev?: boolean, log?: Logger }} options
@param {(id: string) => Promise<any>} loadModule
@param {number} [pid]
@param {number} [nonce]