An open API service indexing awesome lists of open source software.

https://github.com/laptou/ia-zip

Better ZIP parsing for Node.js
https://github.com/laptou/ia-zip

node-js zip

Last synced: 9 months ago
JSON representation

Better ZIP parsing for Node.js

Awesome Lists containing this project

README

          

# `ia-zip`

[![npm](https://img.shields.io/npm/v/ia-zip.svg?style=for-the-badge)](https://www.npmjs.com/package/ia-zip)
![license](https://img.shields.io/npm/l/ia-zip.svg?style=for-the-badge)

This package provides an API for reading and writing ZIP files.

> **Note**: this package is a work in progress. Right now, you can only read zip files.

# API
Docs generated using [`docts`](https://github.com/charto/docts)
>
>
> ### Interface [`ZipCentralDirectoryInfo`](#api-ZipCentralDirectoryInfo)
> Source code: [`<>`](http://github.com/laptou/ia-zip/blob/fdde2bc/src/parser.ts#L135-L145)
>
> Properties:
> > **.currentDiskNumber** number
> > **.startDiskNumber** number
> > **.entriesOnCurrentDisk** number
> > **.totalEntries** number
> > **.centralDirectorySize** number
> > **.centralDirectoryOffset** number
> > **.comment** string
> > **.isZip64** boolean
>
>
> ### Interface [`ZipEntryInfo`](#api-ZipEntryInfo)
> Source code: [`<>`](http://github.com/laptou/ia-zip/blob/fdde2bc/src/parser.ts#L99-L133)
>
> Properties:
> > **.vendor** number
> > **.version** number
> >  The ZIP specification version of this file.
> > **.requiredVersion** number
> >  The minimum ZIP specification version required to
> >  open this file.
> > **.flags** number
> > **.compressionMethod** (undefined) | (undefined) | (undefined) | (undefined) | (undefined) | (undefined) | (undefined) | (undefined) | (undefined) | (undefined) | (undefined) | (undefined) | (undefined) | (undefined) | (undefined)
> > **.modificationTime** Date
> > **.crc32** number
> > **.compressedSize** number
> > **.uncompressedSize** number
> > **.fileName** string
> > **.fileComment** string
> > **.attributes** number
> > **.localHeaderOffset** number
>
>
> ### Class [`ZipReader`](#api-ZipReader)
> Source code: [`<>`](http://github.com/laptou/ia-zip/blob/fdde2bc/src/parser.ts#L147-L418)
>
> Methods:
> > **new( )** [ZipReader](#api-ZipReader) [`<>`](http://github.com/laptou/ia-zip/blob/fdde2bc/src/parser.ts#L172)
> >  ▪ data Buffer
> > **new( )** [ZipReader](#api-ZipReader) [`<>`](http://github.com/laptou/ia-zip/blob/fdde2bc/src/parser.ts#L173)
> >  ▪ filename string
> > **new( )** [ZipReader](#api-ZipReader) [`<>`](http://github.com/laptou/ia-zip/blob/fdde2bc/src/parser.ts#L174)
> >  ▪ stream Stream
> > **.ready( )** Promise<void> [`<>`](http://github.com/laptou/ia-zip/blob/fdde2bc/src/parser.ts#L180-L183)
> > **.readInfo( )** Promise<[ZipCentralDirectoryInfo](#api-ZipCentralDirectoryInfo)> [`<>`](http://github.com/laptou/ia-zip/blob/fdde2bc/src/parser.ts#L185-L258)
> > **.readEntries( )** AsyncIterableIterator<[ZipEntryInfo](#api-ZipEntryInfo)> [`<>`](http://github.com/laptou/ia-zip/blob/fdde2bc/src/parser.ts#L260-L377)
> > **.readEntry( )** Promise<Readable> [`<>`](http://github.com/laptou/ia-zip/blob/fdde2bc/src/parser.ts#L380-L412)
> >  ▪ entry [ZipEntryInfo](#api-ZipEntryInfo)
> > **.close( )** Promise<void> [`<>`](http://github.com/laptou/ia-zip/blob/fdde2bc/src/parser.ts#L414-L417)