JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 824468
  • Score
    100M100P100Q189207F
  • License MIT

Get the brotli compressed size of a string or buffer

Package Exports

  • brotli-size

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (brotli-size) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.

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