gzip-uncompressed-size
Version:
Determine the estimated uncompressed size from a GZIP file (uses ISIZE)
42 lines (29 loc) • 1.18 kB
Markdown
gzip-uncompressed-size
======================
> Determine the estimated uncompressed size from a GZIP file (uses ISIZE)
[](http://badge.fury.io/js/gzip-uncompressed-size)
[](https://travis-ci.org/jviotti/node-gzip-uncompressed-size)
[](https://ci.appveyor.com/project/jviotti/node-gzip-uncompressed-size/branch/master)
This module returns the GZIP `ISIZE`, which according to the [specification],
contains the size of the original (uncompressed) input. It has been documented
that the size reported is not 100% accurate.
Install
-------
```sh
$ npm install --save gzip-uncompressed-size
```
Usage
-----
```js
const gzipUncompressedSize = require('gzip-uncompressed-size');
gzipUncompressedSize.fromFile('my/compressed/file.gz', (error, uncompressedSize) => {
if (error) {
throw error;
}
console.log(uncompressedSize);
});
```
License
-------
MIT
[specification]: https://tools.ietf.org/html/rfc1952