brotli-size

  • Version 4.0.0
  • Published
  • 140 kB
  • 1 dependency
  • MIT license

Install

npm i brotli-size
yarn add brotli-size
pnpm add brotli-size

Overview

Get the brotli compressed size of a string or buffer

Index

Functions

function file

file: (path: string, options?: BrotliEncodeParams) => Promise<number>;
  • Parameter path

    File Path for the file to compress.

    Parameter options

    Subset of Encoding Parameters. Promise that resolves with size of encoded file.

function fileSync

fileSync: (path: string, options?: BrotliEncodeParams) => number;
  • Parameter path

    File Path for the file to compress.

    Parameter options

    Subset of Encoding Parameters. size of encoded file.

function size

size: (
incoming: Buffer | string,
options?: BrotliEncodeParams
) => Promise<number>;
  • Parameter incoming

    Either a Buffer or string of the value to encode.

    Parameter options

    Subset of Encoding Parameters. Promise that resolves with the encoded Buffer length.

function stream

stream: (options?: BrotliEncodeParams) => PassThroughStream;
  • Parameter options

    PassThroughStream for the contents being compressed

function sync

sync: (incoming: Buffer | string, options?: BrotliEncodeParams) => number;
  • Parameter incoming

    Either a Buffer or string of the value to encode.

    Parameter options

    Subset of Encoding Parameters. Length of encoded Buffer.

Interfaces

interface BrotliEncodeParams

interface BrotliEncodeParams {}

    property mode

    mode?: number;

      property quality

      quality?: number;

        Package Files (1)

        Dependencies (1)

        Dev Dependencies (4)

        Peer Dependencies (0)

        No peer dependencies.

        Badge

        To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

        You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/brotli-size.

        • Markdown
          [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/brotli-size)
        • HTML
          <a href="https://www.jsdocs.io/package/brotli-size"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>