0.2.0 • Published 9 months ago

async-zip-reader v0.2.0

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

async-zip-reader

with async-zip-reader, you can read zip files content without store entire file to memory (only on user-provided file or read from HTTP Range request supported server).

Usage

import { ZipReader, PassthroughBlobProvider } from "async-zip-reader"

const input = document.querySelector("input[type=file]")
input.addEventListener("change", () => {
  const zip = await ZipReader.init(new PassthroughBlobProvider(input.files[0]))
  alert("Files:\n" + zip.files.map(file => file.fileName).join("\n"))
  const firstFile = zip.extract(zip.files[0])
  const a = document.createElement("a")
  a.href = URL.createObjectURL(firstFile)
  a.target = "_blank"
  a.click()
})
0.2.0

9 months ago

0.1.0

2 years ago