brotli-size

WebJar for brotli-size

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

brotli-size
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

brotli-size
WebJar for brotli-size
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/erwinmombay/brotli-size

Download brotli-size

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/brotli-size/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>brotli-size</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/brotli-size/
implementation 'org.webjars.npm:brotli-size:0.0.1'
// https://jarcasting.com/artifacts/org.webjars.npm/brotli-size/
implementation ("org.webjars.npm:brotli-size:0.0.1")
'org.webjars.npm:brotli-size:jar:0.0.1'
<dependency org="org.webjars.npm" name="brotli-size" rev="0.0.1">
  <artifact name="brotli-size" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='brotli-size', version='0.0.1')
)
libraryDependencies += "org.webjars.npm" % "brotli-size" % "0.0.1"
[org.webjars.npm/brotli-size "0.0.1"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.npm : iltorb jar [1.0.9,2)
org.webjars.npm : duplexer jar [0.1.1,0.2)

Project Modules

There are no modules declared in this project.

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

Note: You must be running node >= 10.16 to use this module. If you're using an older version of node, we recommend upgrading to the latest active LTS release.

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!

Versions

Version
0.0.1