# matthiasmullie/minify

CSS & 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.

Repository: https://github.com/matthiasmullie/minify
Canonical: https://ross.abutalabs.com/products/matthiasmullie-minify
Homepage: https://matthiasmullie.github.io/minify/
Language: PHP
License: MIT
License Family: permissive
Topics: minify, minifier, php, javascript, css, css-minifier, js-minifier, compressor, compression, js
Last push: 2025-06-25T13:14:26+00:00

## Health v2 (maintenance only)
Score: 47/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 28, release rhythm 40, longevity 100
- inputs: {"age_days": 5076, "days_push": 434, "days_rel": 434, "gap_med": 13, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2042, forks 331 (observed 2026-08-28T04:06:08.606853+00:00)

## What it is
A PHP library that minifies CSS and JavaScript by removing whitespace, stripping comments, combining files, and shortening common code patterns. It can be used programmatically via a simple API or from the command line.

## Use cases
- minify css and javascript files in php
- combine multiple css files into one minified file
- reduce page load size by compressing js assets
- inline and rewrite @import statements in css
- optimize css colors and units for smaller output

## When to choose
- you're building a PHP application and want asset minification without external tools like Node
- you need to concatenate and minify CSS/JS at build or runtime in PHP
- you want a well-tested, MIT-licensed minifier with a simple API

## When to avoid
- you need advanced JS minification like tree-shaking or ES6+ transforms (use Terser/esbuild)
- your stack is not PHP-based
- you need minification of other asset types like HTML or SVG

## Facets
- artifact type: library
- maturity: active
- function: compression, build-tool
- domain: web-development, frontend, developer-tools
- platform: php, cli
- tags: css-minifier, js-minifier, asset-optimization, php-library

## Member repositories
- matthiasmullie/minify (main) score 47

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:08.606853+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:58:18.475525+00:00, confidence not recorded.
  - readme: https://github.com/matthiasmullie/minify (fetched 2026-08-28T04:06:08.606853+00:00, sha 06d093f97eef)
  - homepage: https://matthiasmullie.github.io/minify/ (fetched 2026-08-29T10:38:18.519184+00:00, sha ced6014a87a0)
- Data as of 2026-08-30T08:39:29.467469+00:00.
