maxmin

WebJar for maxmin

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

maxmin
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

maxmin
WebJar for maxmin
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/sindresorhus/maxmin

Download maxmin

How to add to project

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

Dependencies

compile (4)

Group / Artifact Type Version
org.webjars.npm : chalk jar [1.0.0,2)
org.webjars.npm : figures jar [1.0.1,2)
org.webjars.npm : gzip-size jar [1.0.0,2)
org.webjars.npm : pretty-bytes jar [1.0.0,2)

Project Modules

There are no modules declared in this project.

maxmin Build Status

Get a pretty output of the original, minified, gzipped size of a string or buffer

Useful for logging the difference between original and minified file in e.g. a build-system.

Install

$ npm install --save maxmin

Usage

const maxmin = require('maxmin');

const max = 'function smoothRangeRandom(min,max){var num=Math.floor(Math.random()*(max-min+1)+min);return this.prev=num===this.prev?++num:num};';

const min = '(function(b,c){var a=Math.floor(Math.random()*(c-b+1)+b);return this.a=a===this.a?++a:a})()';

console.log(maxmin(max, min, true));
//=> '130 B → 91 B → 53 B (gzip)'

API

maxmin(max, min, useGzip?)

max

Type: string | Buffer | number

Original string or its size in bytes.

min

Type: string | Buffer | number

Minified string or its size in bytes.

useGzip

Type: boolean
Default: false

Show gzipped size of min. Pretty slow. Not shown when min is a number.

Versions

Version
1.1.0