PHPackages                             chewett/php-uglifyjs2 - 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. chewett/php-uglifyjs2

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

chewett/php-uglifyjs2
=====================

A basic wrapper around uglifyjs for PHP

v2.1.1(7y ago)33.1k2[1 issues](https://github.com/chewett/php-uglifyjs2/issues)MITPHP

Since Mar 7Pushed 7y ago1 watchersCompare

[ Source](https://github.com/chewett/php-uglifyjs2)[ Packagist](https://packagist.org/packages/chewett/php-uglifyjs2)[ RSS](/packages/chewett-php-uglifyjs2/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (9)Versions (9)Used By (0)

php-uglifyjs
============

[](#php-uglifyjs)

This library is a wrapper around the nodejs [uglifyjs](https://github.com/mishoo/UglifyJS2) script for PHP.

Usage
-----

[](#usage)

```
$ug = new JSUglify();
$output = $ug->uglify(["somefile.js", "secondfile.js"], "output.js");
```

Given an array of input files and an output file location it will minimise the javascript. Options can be passed in as a third parameter

```
$ug = new JSUglify();
$output = $ug->uglify(["somefile.js", "secondfile.js"], "output.js", ['compress' => '']);
```

Here the compress option is given and passed into the uglifyjs command line string as a flag `--compress`

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

[](#installation)

This can be included in your composer project by running

`composer require chewett/php-uglifyjs`

Then running `composer update` will update your composer lock file to include and download this new dependency.

Tests
-----

[](#tests)

Tests can be run with the phpunit test runner using the provided phpunit.xml file.

License
-------

[](#license)

This is licensed under the MIT license. For more information see the [LICENSE](LICENSE) file.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 97% 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

Every ~133 days

Recently: every ~197 days

Total

8

Last Release

2783d ago

Major Versions

v1.0.3 → v2.0.02018-03-31

### Community

Maintainers

![](https://www.gravatar.com/avatar/02458852a02ca160ba0a485d5da8820f363a69fd4014f7cbef4280162498233f?d=identicon)[chewett](/maintainers/chewett)

---

Top Contributors

[![chewett](https://avatars.githubusercontent.com/u/1496922?v=4)](https://github.com/chewett "chewett (32 commits)")[![bronzehedwick](https://avatars.githubusercontent.com/u/637174?v=4)](https://github.com/bronzehedwick "bronzehedwick (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/chewett-php-uglifyjs2/health.svg)

```
[![Health](https://phpackages.com/badges/chewett-php-uglifyjs2/health.svg)](https://phpackages.com/packages/chewett-php-uglifyjs2)
```

PHPackages © 2026

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