Socket
Socket
Sign inDemoInstall

gzip-size

Package Overview
Dependencies
2
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.1 to 4.1.0

12

index.js
'use strict';
const fs = require('fs');
const stream = require('stream');

@@ -45,1 +46,12 @@ const zlib = require('zlib');

};
module.exports.file = (path, options) => {
return new Promise((resolve, reject) => {
const stream = fs.createReadStream(path);
stream.on('error', reject);
const gzipStream = stream.pipe(module.exports.stream(options));
gzipStream.on('error', reject);
gzipStream.on('gzip-size', resolve);
});
};

2

package.json
{
"name": "gzip-size",
"version": "4.0.1",
"version": "4.1.0",
"description": "Get the gzipped size of a string or buffer",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -29,7 +29,7 @@ # gzip-size [![Build Status](https://travis-ci.org/sindresorhus/gzip-size.svg?branch=master)](https://travis-ci.org/sindresorhus/gzip-size)

### gzipSize(input, options)
### gzipSize(input, [options])
Returns a `Promise` for the size.
### gzipSize.sync(input, options)
### gzipSize.sync(input, [options])

@@ -48,7 +48,15 @@ Returns the size.

### gzipSize.stream(options)
### gzipSize.stream([options])
Returns a [`stream.PassThrough`](https://nodejs.org/api/stream.html#stream_class_stream_passthrough). The stream emits a `gzip-size` event and has a `gzipSize` property.
### gzipSize.file(path, [options])
Returns a `Promise` for the size of the file.
#### path
Type: `string`
## Related

@@ -55,0 +63,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc