async function loadPackageFile({ module, version, path = '' }) {
	path = path.replace(/^\.?\//g, '');

	// console.log('loadPackageFile: ', module, version, path);
	// first, check if this file is sitting in the in-memory cache:
	const files = tarFiles.get(module + '/' + version);
	if (files) {
		const inMemory = files.get(path);
		// console.log(`${path} using in-memory strategy ${inMemory ? 'HIT' : 'MISS'}`);
		if (inMemory) return inMemory;
		return whenFile({ module, version, path });
	}

	// otherwise, check if it's available in node_modules:
	const cacheKey = `${module}@${version} :: \n${path}`;
	let file = DISK_CACHE.get(cacheKey);
	if (file != null) {
		return file;
	}

	try {
		const localPath = resolve(NODE_MODULES, module, path);
		const contents = await fs.readFile(localPath, 'utf-8');
		DISK_CACHE.set(cacheKey, contents);
		return contents;
	} catch (e) {
		const packageExists = await fs.stat(resolve(NODE_MODULES, module)).catch(() => null);
		// console.log(
		// 	`${path} not found, there is ${packageExists ? 'a' : 'no'} package at ${resolve(NODE_MODULES, module)}:\n${
		// 		e.message
		// 	}`
		// );
		if (packageExists) {
			// the package has been streamed to disk, but it doesn't contain this file.
			throw Error(`File not found ${e.message}`);
		}
	}

	// console.log(`${module}/${path} using tar stream strategy`);
	// trigger package fetch, and resolve as soon as the file passes through the tar stream:
	loadPackageFiles({ module, version });
	return whenFile({ module, version, path });

	// OLD: get all files, then return the requested one
	// const files = await loadPackageFiles({ module, version });
	// if (!files.has(path)) {
	// 	throw Error(`Package ${module} does not contain file ${path}`);
	// }
	// return files.get(path);
}
Read a single file from an npm package
@param {Module} info