function parseTarball(bodyStream, onFile) {
	return new Promise((resolve, reject) => {
		const extract = tar.extract();

		extract.on('entry', (header, stream, next) => {
			let { type, name } = header;
			name = name.replace(/^package\//, '');

			if (type !== 'file' || !FILES_INCLUDE.test(name) || FILES_EXCLUDE.test(name)) {
				stream.resume();
				return next();
			}

			onFile(name, stream).then(next);
		});

		extract.on('finish', resolve);
		extract.on('error', reject);

		bodyStream.pipe(zlib.createGunzip()).pipe(extract);
	});
}
@param {import('stream').Readable} bodyStream
@param {(name: string, stream: import('stream').PassThrough) => Promise} onFile