# z-pattern-matching/z

Pattern Matching for Javascript

Repository: https://github.com/z-pattern-matching/z
Canonical: https://ross.abutalabs.com/products/z-pattern-matching-z
Homepage: https://z-pattern-matching.github.io/
Language: JavaScript
License: Apache-2.0
License Family: permissive
Topics: pattern-matching, functional-programming, immutability
Last push: 2023-10-28T18:22:35+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": 4019, "days_push": 1040, "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 1712, forks 48 (observed 2026-08-28T04:05:25.884294+00:00)

## What it is
A JavaScript library providing native-style pattern matching, allowing expressive matching on values, object properties, types, class instances, and array contents with head/tail destructuring. It encourages functional, immutable code as an alternative to imperative conditionals.

## Use cases
- match objects by property values in javascript
- pattern match on array contents with head and tail
- replace switch statements with pattern matching
- match values by type or class instance
- write recursive array processing with pattern matching
- functional style conditionals in node.js

## When to avoid
- you need TypeScript-native pattern matching with type safety
- your project is performance-critical and can't afford abstraction overhead
- you need a library with frequent updates and active maintenance

## Facets
- artifact type: library
- maturity: maintenance
- function: parser, developer-tools
- domain: programming-languages, web-development
- platform: cross-platform
- tags: pattern-matching, functional-programming, immutability, switch-statement, algorithms, nodejs, javascript

## Member repositories
- z-pattern-matching/z (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:25.884294+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-30T03:34:53.727449+00:00, confidence not recorded.
  - readme: https://github.com/z-pattern-matching/z (fetched 2026-08-28T04:05:25.884294+00:00, sha 416095cd7bb6)
  - homepage: https://z-pattern-matching.github.io/ (fetched 2026-08-29T11:11:20.038919+00:00, sha 316845f1b81f)
  - registry_npm: https://registry.npmjs.org/z (fetched 2026-08-29T11:11:20.048276+00:00, sha 6c7ddf3f2986)
- Data as of 2026-08-30T08:39:29.467469+00:00.
