Rich-Harris/magic-string
Manipulate strings like a wizard observed · 2026-08-28
Health v2 · maintenance only
99/100
- Activity 99
- Release rhythm 99
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: 6.0
- age_days: 4321
- days_rel: 7
- days_push: 7
- n_releases_24m: 9
Adoption not part of the score
2770 stars · 125 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
A small, fast TypeScript library for editing strings in place (update, prepend, append, move, overwrite) while generating accurate v3 source maps. It is widely used by bundlers and transpilers for lightweight source-code transformations without a full AST.
Use cases
- generate source maps while patching source code strings
- make small edits to code without a full AST parser
- wrap code with a header and footer preserving sourcemap accuracy
- build a custom bundler or transpiler step
- transform non-JavaScript text files with sourcemap support
- indent or move code sections while keeping mappings valid
When to choose
- you need string-level code edits with sourcemap generation
- recast or a full AST toolchain is overkill for your transformation
- your source language is not JavaScript but you still need sourcemaps
- you are writing a bundler, plugin, or code-mod that patches files lightly
When to avoid
- you need structural AST-based refactoring with formatting preservation
- you only need plain string manipulation with no sourcemaps
- your project requires CommonJS require() since it is ESM-only
Facets
library · maturity stable
parser serialization developer-tools developer-tools web-development parsers browser sourcemap-generation string-manipulation code-transformation esm-only build-tools-utility nodejs javascript
2 sources
- readme: https://github.com/Rich-Harris/magic-string · fetched 2026-08-28 · 8e8a70eeeac9
- registry_npm: https://registry.npmjs.org/magic-string · fetched 2026-08-29 · 87d0207f5625
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| Rich-Harris/magic-string | main | 99 |
For agents
markdown · JSON · MCP: product_card(name="Rich-Harris/magic-string")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem