PHPackages                             composer/metadata-minifier - 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. composer/metadata-minifier

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

composer/metadata-minifier
==========================

Small utility library that handles metadata minification and expansion.

1.0.0(5y ago)181115.0M—5.4%410MITPHPPHP ^5.3.2 || ^7.0 || ^8.0CI passing

Since Apr 7Pushed 4mo ago2 watchersCompare

[ Source](https://github.com/composer/metadata-minifier)[ Packagist](https://packagist.org/packages/composer/metadata-minifier)[ Fund](https://packagist.com)[ GitHub Sponsors](https://github.com/composer)[ RSS](/packages/composer-metadata-minifier/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (10)

composer/metadata-minifier
==========================

[](#composermetadata-minifier)

Small utility library that handles metadata minification and expansion.

This is used by [Composer](https://github.com/composer/composer)'s 2.x repository metadata protocol.

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

[](#installation)

Install the latest version with:

```
composer require composer/metadata-minifier
```

Requirements
------------

[](#requirements)

- PHP 5.3.2 is required but using the latest version of PHP is highly recommended.

Basic usage
-----------

[](#basic-usage)

### `Composer\MetadataMinifier\MetadataMinifier`

[](#composermetadataminifiermetadataminifier)

- `MetadataMinifier::expand()`: Expands an array of minified versions back to their original format
- `MetadataMinifier::minify()`: Minifies an array of versions into a set of version diffs

For example to expand the dev versions (note the ~dev in the URL) of Monolog you would do:

```
$packageName = 'monolog/monolog';
$url = 'https://repo.packagist.org/p2/' . $packageName . '~dev.json';
$json = json_decode(file_get_contents($url), true);
$versions = \Composer\MetadataMinifier\MetadataMinifier::expand($json['packages'][$packageName]);
```

License
-------

[](#license)

composer/metadata-minifier is licensed under the MIT License, see the LICENSE file for details.

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance51

Moderate activity, may be stable

Popularity68

Solid adoption and visibility

Community24

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

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

1867d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b69782e1d7f426ef78f61d159c466a536372eff931f13981ac578fa3f4649352?d=identicon)[Seldaek](/maintainers/Seldaek)

---

Top Contributors

[![Seldaek](https://avatars.githubusercontent.com/u/183678?v=4)](https://github.com/Seldaek "Seldaek (12 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![Chris8934](https://avatars.githubusercontent.com/u/44963939?v=4)](https://github.com/Chris8934 "Chris8934 (1 commits)")[![tacman](https://avatars.githubusercontent.com/u/619585?v=4)](https://github.com/tacman "tacman (1 commits)")

---

Tags

composercompression

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/composer-metadata-minifier/health.svg)

```
[![Health](https://phpackages.com/badges/composer-metadata-minifier/health.svg)](https://phpackages.com/packages/composer-metadata-minifier)
```

###  Alternatives

[kriswallsmith/assetic

Asset Management for PHP

3.7k48.9M161](/packages/kriswallsmith-assetic)[jean85/pretty-package-versions

A library to get pretty versions strings of installed dependencies

1.3k289.5M63](/packages/jean85-pretty-package-versions)[ergebnis/composer-normalize

Provides a composer plugin for normalizing composer.json.

1.1k37.3M2.1k](/packages/ergebnis-composer-normalize)[icanhazstring/composer-unused

Show unused packages by scanning your code

1.7k7.0M188](/packages/icanhazstring-composer-unused)[bamarni/composer-bin-plugin

No conflicts for your bin dependencies

52722.0M859](/packages/bamarni-composer-bin-plugin)[alchemy/zippy

Zippy, the archive manager companion

47522.6M51](/packages/alchemy-zippy)

PHPackages © 2026

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