1. brotli-size
Get the brotli compressed size of a string or buffer
brotli-size
Package: brotli-size
Created by: erwinmombay
Last modified: Mon, 10 Jul 2023 17:46:29 GMT
Version: 4.0.0
License: MIT
Downloads: 932,187
Repository: https://github.com/erwinmombay/brotli-size

Install

npm install brotli-size
yarn add brotli-size

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!

Dependencies

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin