Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jsumners/gzinfo
https://github.com/jsumners/gzinfo
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/jsumners/gzinfo
- Owner: jsumners
- Created: 2016-05-20T17:42:53.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-05-20T18:02:21.000Z (over 8 years ago)
- Last Synced: 2024-10-08T12:21:21.753Z (about 1 month ago)
- Language: JavaScript
- Size: 12.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# gzinfo
This is a simple module for reading the header and footer information of a
gzip compressed file. With this module you can get information such as the
uncompressed size of the file and the date when the file was compressed.This module was written using the following references:
+ http://forensicswiki.org/wiki/Gzip
+ http://www.gzip.org/zlib/rfc-gzip.html
+ http://git.savannah.gnu.org/cgit/gzip.git/tree/gzip.h
+ http://git.savannah.gnu.org/cgit/gzip.git/tree/gzip.c## Install
```sh
$ npm install --production gzinfo
```## Example
```js
const gzinfo = require('gzinfo')
const fileInfo = gzinfo('/path/to/some/file.gz')
console.log(`uncompressed size of file.gz is ${fileInfo.uncompressedSize} bytes`)
```## Documentation
The main export is a function `gzinfo(file)`. This is merely a wrapper for the
class `GZInfo(file)`. The wrapper method returns an instance of the class.
The class is exported as `require('gzinfo').GZInfo` if you would like to use
it directly.The full documentation for the class is in [api.md](api.md).
## License
[MIT License](http://jsumners.mit-license.org/)