in src/io/xpi.ts [169:184]
async getFileAsStream(path: string): Promise<Readable> {
this.checkPath(path);
const zipfile = await this.open();
return new Promise((resolve, reject) => {
zipfile.openReadStream(this.files[path], (err, readStream) => {
if (err) {
return reject(err);
}
if (!readStream) {
return reject(new Error('readStream is falsey'));
}
return resolve(readStream.pipe(stripBomStream()));
});
});
}