async-zip-reader
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

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()
})

Readme

Keywords

none

Package Sidebar

Install

npm i async-zip-reader

Weekly Downloads

12

Version

0.2.0

License

MIT

Unpacked Size

22.5 kB

Total Files

21

Last publish

Collaborators

  • rinsuki