brotli-size
Get the brotli compressed size of a string or buffer.
$ npm install --save brotli-size
var brotliSize = require('brotli-size');
var str = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam feugiat, mauris non aliquam pretium, libero nulla ultrices lacus, nec varius est purus sit amet dolor.';
console.log(str.length); // 165
console.log(brotliSize.sync(str)); // 118
Type: string
, buffer
Returns a passthrough stream. The stream emits a brotli-size
event and
has a brotliSize
property.
- gzip-size - Heavily inspired by this module. Thank you for the inspiration!