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

brotli-fsize Build Status

Get the brotli-compressed size of a string or buffer


Attention: This module is based on the native Brotli support, starting with Node version 11.7.0. Therefore it will only work with Node version equal to or higher.

$ npm install brotli-fsize


const brotliSize = require('brotli-fsize');
const 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.';

//=> 191

//=> 134


brotliSize(input, [options])

Returns a Promise for the size.

brotliSize.sync(input, [options])

Returns the size.


Type: string Buffer


Type: Object

Any brotli option.[options])

Returns a stream.PassThrough. The stream emits a brotli-fsize event and has a brotliSize property.

brotliSize.file(path, [options])

Returns a Promise for the size of the file.


Type: string

brotliSize.fileSync(path, [options])

Returns the size of the file.


Inspired by gzip-size

MIT © Developmint (Alexander Lichter)

Current Tags

  • 1.0.3                                ...           latest (2 years ago)

4 Versions

  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Today 0
This Week 0
This Month 9
Last Day 0
Last Week 8
Last Month 14
Dependencies (2)

Copyright 2014 - 2017 © |