unjs/magic-regexp

A compiled-away, type-safe, readable RegExp alternative

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 1 hour ago
Type:Library / SDKCategory(s):Core & Utility LibrariesLanguages & Runtimes
Added to GitGenius on September 16th, 2026
Created on July 16th, 2022
Open Issues & Pull Requests: 34 (+0)
GitHub issues: Enabled
Number of forks: 74
Total Stargazers: 4,338 (+0)
Total Subscribers: 13 (+0)

Repository Insights (GitGenius)

Median issue/PR response: N/A
Mean response time: 72.5 days
90th percentile: 385.7 days
Tracked items: 18

Most active contributors

Sign in to see contributor activity.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 9
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 819 days
Stale 30+ days: 8
Stale 90+ days: 7

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • bug (9)
  • documentation (4)
  • enhancement (4)
  • good first issue (2)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

magic-regexp is a TypeScript library that provides a type-safe, readable alternative to regular expressions that compiles away at build time.

The tool addresses the difficulty of writing and maintaining complex regular expressions by allowing developers to build patterns using a chainable, composable API instead of regex syntax. Patterns are constructed through method calls that read like natural language, then compiled into standard RegExp objects during the build process, eliminating runtime overhead. This approach makes regex logic explicit and verifiable through TypeScript's type system while producing the same efficient compiled output as hand-written patterns.

Developers should choose this tool if they work in TypeScript projects where regex readability and maintainability matter more than writing patterns directly. It suits codebases with complex pattern matching logic where the cost of regex mistakes is high, or teams that find traditional regex syntax difficult to review in code. The tool is particularly valuable when patterns need to be composed from reusable pieces or when type safety around capture groups and pattern structure is desired.

The project shows consistent, focused development with regular updates to the codebase. Maintenance activity demonstrates ongoing attention to the repository with steady commits addressing improvements and fixes. The project maintains an active engagement with its ecosystem, as evidenced by participation in community initiatives. Development appears oriented toward stability and reliability rather than rapid feature expansion, with changes carefully considered before integration.