unjs/magicast
Some data may be outdated — see provenance labels.
🧀 Programmatically modify JavaScript and TypeScript source codes with a simplified, elegant and familiar syntax powered by recast and babel. observed · 2026-10-02
Health v2 · maintenance only
92/100
- Activity 97
- Release rhythm 82
- 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: 59.5
- age_days: 1974
- days_rel: 40
- days_push: 19
- n_releases_24m: 7
Adoption not part of the score
2478 stars · 52 forks observed · 2026-10-02
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
Magicast is a TypeScript library for programmatically modifying JavaScript and TypeScript source files using a simple, JSON-like proxy API over ASTs parsed by recast and Babel. It preserves original code formatting while allowing easy manipulation of imports, exports, and function call arguments.
Use cases
- programmatically edit config files like defineConfig calls
- write codemods to update JS/TS source code
- modify module imports and exports in a file
- append values to exported arrays while preserving formatting
- generate or transform TypeScript configuration files
- manipulate function call arguments in source code
When to choose
- you need to edit JS/TS files programmatically without losing formatting
- writing codemods or config file editors (e.g., Nuxt modules)
- you want readable code manipulation instead of raw AST work
When to avoid
- you only need to parse or lint code without writing it back
- you need full AST-level control for complex transformations (use Babel or jscodeshift directly)
- your target language is not JavaScript or TypeScript
Facets
library · maturity active
parser developer-tools developer-tools parsers web-development ast-manipulation codemod typescript recast babel code-generation nodejs javascript
2 sources
- readme: https://github.com/unjs/magicast · fetched 2026-10-02 · 236220fffcb9
- registry_npm: https://registry.npmjs.org/magicast · fetched 2026-08-29 · 4b9044c71ceb
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| unjs/magicast | main | 92 |
For agents
Data as of 2026-10-19T08:05:51.212177+00:00 · Report a problem