# paulirish/matchMedia.js

matchMedia polyfill for testing media queries in JS

Repository: https://github.com/paulirish/matchMedia.js
Canonical: https://ross.abutalabs.com/products/matchmediajs
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2020-12-22T22:56:49+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 5633, "days_push": 2080, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2361, forks 278 (observed 2026-08-28T04:06:40.891277+00:00)

## What it is
A JavaScript polyfill for the window.matchMedia() API, allowing developers to test whether CSS media types or media queries apply in browsers lacking native support. It also offers an addListener module for reacting to media query changes.

## Use cases
- test media queries in javascript
- polyfill matchMedia in old browsers
- detect mobile screen width in js
- check device orientation in javascript
- run responsive dom scripting based on media queries

## When to choose
- supporting legacy browsers without native matchMedia support
- building responsive scripts that need media query testing in old IE or older Safari

## When to avoid
- targeting only modern browsers that natively support matchMedia
- starting a new project where native APIs suffice

## Facets
- artifact type: library
- maturity: maintenance
- function: developer-tools, ui-components
- domain: web-development, frontend, cross-platform
- platform: browser
- tags: polyfill, media-queries, matchmedia, responsive-design, browser-compatibility, javascript

## Member repositories
- paulirish/matchMedia.js (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:40.891277+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:36:07.110587+00:00, confidence not recorded.
  - readme: https://github.com/paulirish/matchMedia.js (fetched 2026-08-28T04:06:40.891277+00:00, sha dcf9e106f025)
- Data as of 2026-08-30T08:39:29.467469+00:00.
