source: frontend/node_modules/gzip-size/readme.md

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 1.8 KB
Line 
1# gzip-size [![Build Status](https://travis-ci.com/sindresorhus/gzip-size.svg?branch=master)](https://travis-ci.com/github/sindresorhus/gzip-size)
2
3> Get the gzipped size of a string or buffer
4
5## Install
6
7```
8$ npm install gzip-size
9```
10
11## Usage
12
13```js
14const gzipSize = require('gzip-size');
15
16const text = '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.';
17
18console.log(text.length);
19//=> 191
20
21console.log(gzipSize.sync(text));
22//=> 78
23```
24
25## API
26
27### gzipSize(input, options?)
28
29Returns a `Promise<number>` with the size.
30
31### gzipSize.sync(input, options?)
32
33Returns the size.
34
35#### input
36
37Type: `string | Buffer`
38
39#### options
40
41Type: `object`
42
43Any [`zlib` option](https://nodejs.org/api/zlib.html#zlib_class_options).
44
45### gzipSize.stream(options?)
46
47Returns 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.
48
49### gzipSize.file(path, options?)
50
51Returns a `Promise<number>` with the size of the file.
52
53#### path
54
55Type: `string`
56
57### gzipSize.fileSync(path, options?)
58
59Returns the size of the file.
60
61## Related
62
63- [gzip-size-cli](https://github.com/sindresorhus/gzip-size-cli) - CLI for this module
64
65---
66
67<div align="center">
68 <b>
69 <a href="https://tidelift.com/subscription/pkg/npm-gzip-size?utm_source=npm-gzip-size&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
70 </b>
71 <br>
72 <sub>
73 Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
74 </sub>
75</div>
Note: See TracBrowser for help on using the repository browser.