PHPackages                             kamlesh-defsys/mime-types - 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. kamlesh-defsys/mime-types

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

kamlesh-defsys/mime-types
=========================

A converter between mime types and file extensions.

02PHP

Since Jan 13Pushed 1y agoCompare

[ Source](https://github.com/kamleshDefsys/mime-types)[ Packagist](https://packagist.org/packages/kamlesh-defsys/mime-types)[ RSS](/packages/kamlesh-defsys-mime-types/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Mime Types
==========

[](#mime-types)

Converts mime types to the proper file extensions and vice versa.

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

[](#installation)

```
composer require kamlesh-defsys/mime-types
```

Usage
-----

[](#usage)

Create a new mime type converter instance:

```
use kamleshDefsys\MimeTypes\MimeTypeConverter;

$converter = new MimeTypeConverter;
```

Get the proper mime type for a file extension:

```
echo $converter->toMimeType('jpeg');
```

or find a file extension to the given mime type:

```
echo $converter->toExtension('image/jpeg');
```

Multiple extensions could belong to the same mime type so the code above will return with the first matching one.

Development
-----------

[](#development)

Create the Docker based development environment:

```
make dev
```

Check the coding style and run unit tests:

```
make test
```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 Bus Factor1

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

### Community

Maintainers

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

---

Top Contributors

[![fabricioaloware](https://avatars.githubusercontent.com/u/151675341?v=4)](https://github.com/fabricioaloware "fabricioaloware (3 commits)")[![kamleshDefsys](https://avatars.githubusercontent.com/u/51432144?v=4)](https://github.com/kamleshDefsys "kamleshDefsys (2 commits)")

### Embed Badge

![Health badge](/badges/kamlesh-defsys-mime-types/health.svg)

```
[![Health](https://phpackages.com/badges/kamlesh-defsys-mime-types/health.svg)](https://phpackages.com/packages/kamlesh-defsys-mime-types)
```

###  Alternatives

[soup/paginator

Paginator is a simple class that allows you to create pagination. It doesn't require any database connection. It is compatible with Twitter's Bootstrap Framework, by using the CSS class pagination that is also attached.

351.5k](/packages/soup-paginator)[components/jquery-htmlclean

HTML Clean plug-in for jQuery

183.1k1](/packages/components-jquery-htmlclean)

PHPackages © 2026

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