brotli-size
Get the brotli compressed size of a string or buffer
Last updated 6 years ago by erwinmombay .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install brotli-size 
SYNC missed versions from official npm registry.

brotli-size

Get the brotli compressed size of a string or buffer.

Install

$ npm install --save brotli-size

Usage

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

API

brotliSize.sync(input)

input

Type: string, buffer

brotliSize.stream()

Returns a passthrough stream. The stream emits a brotli-size event and has a brotliSize property.

Related

  • gzip-size - Heavily inspired by this module. Thank you for the inspiration!

Current Tags

  • 4.0.0                                ...           latest (5 years ago)

8 Versions

  • 4.0.0                                ...           5 years ago
  • 3.0.1                                ...           5 years ago
  • 3.0.0                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
  • 0.1.0                                ...           6 years ago
  • 0.0.3                                ...           6 years ago
  • 0.0.2                                ...           7 years ago
  • 0.0.1                                ...           9 years ago
Maintainers (1)
Downloads
Total 8
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE