PHPackages                             hexydec/jslite - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. hexydec/jslite

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

hexydec/jslite
==============

A token based Javascript parser/minifier designed for compressing inline scripts on the fly, written in PHP

1.0.7(1mo ago)810.9k↓31.3%1[1 PRs](https://github.com/hexydec/jslite/pulls)1MITPHPPHP &gt;=8.1CI passing

Since May 22Pushed 3mo ago1 watchersCompare

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

READMEChangelog (10)Dependencies (6)Versions (23)Used By (1)

JSlite: PHP Javascript Minifier
===============================

[](#jslite-php-javascript-minifier)

A Javascript compiler designed for minifying inline scripts, written in PHP.

[![Licence: MIT](https://camo.githubusercontent.com/1be08aa7893603196bc3465a2235df43f54fab679741e5cdb07b9f513c5dd5d7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e63652d4d49542d6c69676874677265792e737667)](https://camo.githubusercontent.com/1be08aa7893603196bc3465a2235df43f54fab679741e5cdb07b9f513c5dd5d7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e63652d4d49542d6c69676874677265792e737667)[![Status: Stable](https://camo.githubusercontent.com/af83a8dcabf200b08620cd9f1e69904403bdef64b5962d6ff3126c88446bf9e2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5374617475732d537461626c652d477265656e2e737667)](https://camo.githubusercontent.com/af83a8dcabf200b08620cd9f1e69904403bdef64b5962d6ff3126c88446bf9e2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5374617475732d537461626c652d477265656e2e737667)[![Tests Status](https://github.com/hexydec/jslite/actions/workflows/tests.yml/badge.svg)](https://github.com/hexydec/jslite/actions/workflows/tests.yml)[![Code Coverage](https://camo.githubusercontent.com/a0570884956e955ea0dc0eaf4af9c759dd150ecc3688b151d8ba73ae7b318638/68747470733a2f2f636f6465636f762e696f2f67682f686578796465632f6a736c6974652f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://app.codecov.io/gh/hexydec/jslite)

Description
-----------

[](#description)

Designed to complement [HTMLdoc](http://github.com/hexydec/htmldoc), JSlite is a Javascript compiler and minifier, designed for minifying inline Javascript on the fly. It can also be used for compressing larger documents.

The software is implemented as a compiler to ensure reliable, and comes with a full test suite.

Usage
-----

[](#usage)

To minify Javascript:

```
use hexydec\jslite\jslite;

$doc = new jslite();

// load from a variable
if ($doc->load($javascript) {

	// minify the document
	$doc->minify();

	// retrieve the javascript
	echo $doc->compile();
}
```

You can test out the minifier online at , or run the supplied `index.php` file after installation.

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

[](#installation)

The easiest way to get up and running is to use composer:

```
$ composer install hexydec/jslite

```

Test Suite
----------

[](#test-suite)

You can run the test suite like this:

### Linux

[](#linux)

```
$ vendor/bin/phpunit

```

### Windows

[](#windows)

```
> vendor\bin\phpunit

```

Support
-------

[](#support)

JSlite supports PHP version 8.0+.

Documentation
-------------

[](#documentation)

- [API Reference](docs/api/readme.md)

Contributing
------------

[](#contributing)

If you find an issue with JSlite, please create an issue in the tracker.

If you wish to fix an issue yourself, please fork the code, fix the issue, then create a pull request, and I will evaluate your submission.

Licence
-------

[](#licence)

The MIT License (MIT). Please see [License File](LICENCE) for more information.

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance83

Actively maintained with recent releases

Popularity31

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity70

Established project with proven stability

 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

Every ~88 days

Recently: every ~201 days

Total

21

Last Release

55d ago

Major Versions

0.6.3 → 1.0.02023-02-11

PHP version history (4 changes)0.4.0PHP &gt;=7.3

0.5.6PHP &gt;=7.4

1.0.1PHP &gt;=8.0

1.0.4PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/5257ffcb9e543c03368e1090d353092b40b1491d15cd3126d14d3d32975b6384?d=identicon)[hexydec](/maintainers/hexydec)

---

Top Contributors

[![hexydec](https://avatars.githubusercontent.com/u/743478?v=4)](https://github.com/hexydec "hexydec (103 commits)")

---

Tags

compilercompressing-inline-scriptscompressionjavascriptminificationjavascriptparserJSminifyminifiercompiler

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/hexydec-jslite/health.svg)

```
[![Health](https://phpackages.com/badges/hexydec-jslite/health.svg)](https://phpackages.com/packages/hexydec-jslite)
```

###  Alternatives

[matthiasmullie/minify

CSS &amp; JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.

2.0k30.5M336](/packages/matthiasmullie-minify)[hexydec/htmldoc

A token based HTML document parser and minifier. Minify HTML documents including inline CSS, Javascript, and SVG's on the fly. Extract document text, attributes, and fragments. Full test suite.

2610.3k3](/packages/hexydec-htmldoc)[nicoswd/php-rule-parser

Rule Engine - Rule Parser &amp; Evaluator

13078.6k7](/packages/nicoswd-php-rule-parser)[mishal/iless

Less.js port to PHP

4737.0k3](/packages/mishal-iless)[ovidigital/js-object-to-json

PHP library to convert a JavaScript object string to JSON formatted string

18177.7k6](/packages/ovidigital-js-object-to-json)[ffi/preprocessor

Simple C Preprocessor

2637.0k13](/packages/ffi-preprocessor)

PHPackages © 2026

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