unjs/magic-regexp
Some data may be outdated — see provenance labels.
A compiled-away, type-safe, readable RegExp alternative observed · 2026-10-02
Health v2 · maintenance only
89/100
- Activity 97
- Release rhythm 72
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-10-21. Adoption (stars, forks) is never an input.
- gap_med: 106.0
- age_days: 1557
- days_rel: 29
- days_push: 19
- n_releases_24m: 5
Adoption not part of the score
4338 stars · 74 forks observed · 2026-10-02
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-10-02 · 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 | 89 |
For agents
markdown · JSON · MCP: product_card(name="unjs/magic-regexp")
Data as of 2026-10-19T08:05:51.212177+00:00 · Report a problem