| Server IP : 157.230.181.24 / Your IP : 216.73.217.11 Web Server : Apache/2.4.58 (Ubuntu) System : Linux conductive 6.8.0-117-generic #117-Ubuntu SMP PREEMPT_DYNAMIC Tue May 5 19:26:24 UTC 2026 x86_64 User : ( 1000) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/vhosts/convo/node_modules/gzip-size/ |
Upload File : |
# gzip-size [](https://travis-ci.org/sindresorhus/gzip-size)
> Get the gzipped size of a string or buffer
## Install
```
$ npm install --save gzip-size
```
## Usage
```js
var gzipSize = require('gzip-size');
var string = 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.';
console.log(string.length);
//=> 191
console.log(gzipSize.sync(string));
//=> 78
```
## API
### gzipSize(input, callback)
### gzipSize.sync(input)
#### input
Type: `string`, `buffer`
#### callback(error, size)
Type: `function`
### gzipSize.stream()
Returns a passthrough stream. The stream emits a `gzip-size` event and has a `gzipSize` property.
## Related
- [gzip-size-cli](https://github.com/sindresorhus/gzip-size-cli) - CLI for this module
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)