X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Fgzip-size%2Freadme.md;fp=node_modules%2Fgzip-size%2Freadme.md;h=7dc2cda3159aafbc7015ac50f70ca541b1c6cb53;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/gzip-size/readme.md b/node_modules/gzip-size/readme.md new file mode 100644 index 000000000..7dc2cda31 --- /dev/null +++ b/node_modules/gzip-size/readme.md @@ -0,0 +1,52 @@ +# gzip-size [![Build Status](https://travis-ci.org/sindresorhus/gzip-size.svg?branch=master)](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)