PHPackages                             garfix/js-minify - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. garfix/js-minify

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

garfix/js-minify
================

A fast Javascript minifier that removes unnecessary whitespace and comments

1.0.0(4y ago)45.0k↓33.3%1[3 issues](https://github.com/garfix/js-minify/issues)MITPHPPHP &gt;=5.6

Since Oct 11Pushed 3y ago1 watchersCompare

[ Source](https://github.com/garfix/js-minify)[ Packagist](https://packagist.org/packages/garfix/js-minify)[ RSS](/packages/garfix-js-minify/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

js-minify
=========

[](#js-minify)

A fast Javascript minifier that removes unnecessary whitespace and comments

Installation
------------

[](#installation)

If you are using Composer, use

```
composer require garfix/js-minify

```

Use
---

[](#use)

The simplest use of the library comes down to this:

```
$minifiedJs = \Garfix\JsMinify\Minifier::minify($js);

```

Where `$js` contains the unprocessed code and `$minifiedJs` holds the minified version.

If you want to change the default options, use `minify($js, $options)`, where `$options` is an array of one or more of the following:

- `\Garfix\JsMinify\Minifier::FLAGGED_COMMENTS` (bool, default: `true`) When set to `false`, `/*! ... */` flagged comments are removed as well.

Background
----------

[](#background)

I started this library because I believed [JShrink](https://github.com/tedious/JShrink) could be made much faster by the use of dedicated regular expressions. This turned out to be true. It is about 10x faster on PHP 7 and 5x faster on PHP 8.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance5

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1679d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/884d59fad69aa1a04c2cdb1bcdc0f6519a3f83abd7c8dad8957c46f2ac517a05?d=identicon)[garfix](/maintainers/garfix)

---

Top Contributors

[![garfix](https://avatars.githubusercontent.com/u/5256409?v=4)](https://github.com/garfix "garfix (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/garfix-js-minify/health.svg)

```
[![Health](https://phpackages.com/badges/garfix-js-minify/health.svg)](https://phpackages.com/packages/garfix-js-minify)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
