unjs/magic-regexp
A compiled-away, type-safe, readable RegExp alternative observed · 2026-08-28
Health v2 · maintenance only
82/100
- Activity 99
- Release rhythm 49
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-02. Adoption (stars, forks) is never an input.
- gap_med: 165.0
- age_days: 1509
- days_rel: 181
- days_push: 9
- n_releases_24m: 3
Adoption not part of the score
4335 stars · 72 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
magic-regexp is a TypeScript library providing a readable, natural-language builder for regular expressions with automatically typed capture groups. It ships with build-time transforms (for Nuxt, Vite, webpack, unbuild) that compile expressions to plain RegExp for zero runtime overhead.
Use cases
- write readable regex without cryptic syntax
- get type-safe capture groups from regular expressions
- compile regex builders away at build time to plain RegExp
- build regular expressions with a natural language fluent API
- validate and extract strings with typed regex matches
When to choose
- you want maintainable, self-documenting regex in a TypeScript project
- you need typed capture groups instead of untyped match results
- you use Nuxt, Vite, or webpack and want zero-runtime compiled regex
When to avoid
- you need advanced regex features not covered by the builder API
- you are not using TypeScript and cannot benefit from the type safety
- you need maximum performance from hand-tuned raw regex
Facets
library · maturity active
parser developer-tools type-system developer-tools programming-languages web-development cross-platform regex regexp type-safe build-time-transform nuxt vite-plugin nodejs typescript
4 sources
- readme: https://github.com/unjs/magic-regexp · fetched 2026-08-28 · 8ca2945e0953
- homepage: https://regexp.dev · fetched 2026-08-29 · 40ee956c88dc
- site_page: https://regexp.dev/guide · fetched 2026-08-29 · b520b7b2812a
- registry_npm: https://registry.npmjs.org/magic-regexp · fetched 2026-08-29 · 5db0e5627cba
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| unjs/magic-regexp | main | 82 |
For agents
markdown · JSON · MCP: product_card(name="unjs/magic-regexp")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem