mirror of
https://github.com/codedread/bitjs
synced 2025-10-03 09:39:16 +02:00
Fix issue #38: Use runtime's native DecompressionStream to inflate zip streams.
This commit is contained in:
parent
5bf583c617
commit
4ca68bd336
4 changed files with 48 additions and 15 deletions
|
@ -316,3 +316,22 @@ export function getUnarchiver(ab, options = {}) {
|
|||
}
|
||||
return unarchiver;
|
||||
}
|
||||
|
||||
// import * as fs from 'node:fs';
|
||||
// async function main() {
|
||||
// const nodeBuf = fs.readFileSync(`./action-1.cbz`);
|
||||
// const ab = nodeBuf.buffer.slice(nodeBuf.byteOffset, nodeBuf.byteOffset + nodeBuf.length);
|
||||
// const then = Date.now();
|
||||
// const zipper = new Unzipper(ab, {debug: true});
|
||||
// zipper.addEventListener('extract', evt => {
|
||||
// const f = evt.unarchivedFile;
|
||||
// fs.writeFileSync(f.filename, Buffer.from(f.fileData));
|
||||
// });
|
||||
// zipper.addEventListener('finish', evt => {
|
||||
// console.dir(evt);
|
||||
// console.log(`Took ${(Date.now() - then)}ms`);
|
||||
// });
|
||||
// await zipper.start();
|
||||
// }
|
||||
|
||||
// main();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue