Rich-Harris/magic-string
Some data may be outdated — see provenance labels.
Manipulate strings like a wizard observed · 2026-09-27
Health v2 · maintenance only
97/100
- Activity 96
- Release rhythm 96
- 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: 5.0
- age_days: 4369
- days_rel: 27
- days_push: 27
- n_releases_24m: 15
Adoption not part of the score
2777 stars · 130 forks observed · 2026-09-27
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-09-27 · 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 | 97 |
For agents
markdown · JSON · MCP: product_card(name="Rich-Harris/magic-string")
Data as of 2026-10-19T08:05:51.212177+00:00 · Report a problem