0.1.1 • Published 8 months ago

@buh/unzip v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

unzip

Installation

npm install @buh/unzip

Quick Examples

Bun

Use inflateSync from Bun.inflateSync

import { Zip } from '@buh/unzip';

const file = Bun.file('archive.zip');
const arrayBuffer = await file.arrayBuffer();

const zip = await Zip.create(arrayBuffer);
for (const entry of zip.iterator()) {
  console.log(entry.fileName, entry.lastModified(), zip.textDecoder.decode(entry.getData()));
}

Node

Use inflateRawSync from node:zlib

import { Zip } from '@buh/unzip';
import { readFileSync } from 'node:fs';

const file = readFileSync('archive.zip');

const zip = await Zip.create(file.buffer);
for (const entry of zip.iterator()) {
  console.log(entry.fileName, entry.lastModified(), zip.textDecoder.decode(entry.getData()));
}

References

Chagelogs

You can track the changelogs in CHANGELOGS.md file.

0.1.1

8 months ago

0.1.0

8 months ago