</>PackageGraphPackageGraph

magicast

npmv0.5.4TypeScript

Modify a JS/TS file and write back magically just like JSON!

Safe to adopt

Yes — magicast scores well across adoption, maintenance, weight, supply chain, and licensing. 33.9M downloads per week and 3 known dependents. Last published 41 days ago. 6 releases in the last 2 years.

  • AAdoption: grade A, Excellent.

    33.9M downloads per week and 3 known dependents.

  • AMaintenance: grade A, Excellent.

    Last published 41 days ago. 6 releases in the last 2 years.

  • AWeight: grade A, Excellent.

    Pulls in 5 transitive packages, about 4.5 MB installed.

  • ASupply chain: grade A, Excellent.

    No install scripts, 2 maintainers, and a contained dependency surface.

  • ALicense: grade A, Excellent.

    MIT — permissive, with no copyleft found in the dependency tree.

Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.

Install cost

What you actually take on by adding magicast to a project.

3
Direct dependencies

Runtime packages this one declares itself.

5
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

4.5 MB
Install size

Unpacked size of this package plus its entire runtime tree.

2
Tree depth

Longest resolved dependency chain below this package.

Licenses in the dependency tree

BSD-3-ClauseMIT

Every license you inherit by installing magicast, not just its own. Check this before a legal review, not after.

Compatibility

Node.js
No constraint declared
Module format
ESM + CommonJS
TypeScript
Types included
Install scripts
None

Quick start

A usage example from the magicast README.

import { parseModule, generateCode, builders, createNode } from "magicast";

Dependencies

Declared by magicast v0.5.4. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (20)

@types/node ^26.1.2@vitest/coverage-v8 ^4.1.10@vitest/ui ^4.1.10ast-types ^0.16.1bumpp ^12.1.1eslint ^9.39.4eslint-config-unjs ^0.6.2giget ^3.3.1jiti ^2.7.0magicast 0.5.4nano-staged ^1.0.2prettier ^3.9.6recast ^0.23.18simple-git-hooks ^2.13.1source-map npm:source-map-js@latesttaze ^19.16.0tsdown ^0.22.14tsx ^4.23.1typescript ^6.0.3vitest ^4.1.10

Used by

Popular packages that depend on magicast.

Relationship graph

Dependencies (left) and dependents (right) of magicast.

Frequently installed together

Release history

6 releases in the last two years, typically about 49 days apart.

Recent versions of magicast
VersionPublishedSizeLicense
0.5.4latest1 month ago372 KBMIT
0.5.33 months ago368 KBMIT
0.5.27 months ago370 KBMIT
0.5.110 months ago370 KBMIT
0.5.010 months ago370 KBMIT
0.4.010 months ago654 KBMIT
0.3.52 years ago634 KBMIT
0.3.42 years ago632 KBMIT
0.3.32 years ago630 KBMIT
0.3.22 years ago628 KBMIT
0.3.12 years ago628 KBMIT
0.3.03 years ago628 KBMIT
0.2.113 years ago97 KBMIT
0.2.103 years ago79 KBMIT
0.2.93 years ago75 KBMIT

Overview

magicast is an npm package that modify a JS/TS file and write back magically just like JSON!. It is extremely widely used, with about 33.9M downloads per week and 3 known dependents in the graph. The latest version is 0.5.4, released under the MIT license.

Who should use it

Teams working in the npm ecosystem who need modify a JS/TS file and write back magically just like JSON! and value a battle-tested, widely-adopted solution.

When not to use it

Consider an alternative if you need to minimize your dependency tree, or if a more actively-maintained option better fits your npm stack.

Pros

  • Large, well-established user base (33.9M weekly downloads).
  • Ships TypeScript type definitions.
  • Clear open-source license (MIT).

Cons

  • Large dependency tree (23 direct dependencies) increases install size and audit surface.

Auto-generated from collected registry metadata. No external claims are inferred.

Maintainers

Frequently asked questions

Should I use magicast?

Yes — magicast scores well across adoption, maintenance, weight, supply chain, and licensing. 33.9M downloads per week and 3 known dependents. Last published 41 days ago. 6 releases in the last 2 years.

How do I install magicast?

Run `npm install magicast` to add magicast to your npm project.

How many dependencies does magicast have?

magicast declares 23 direct dependencies and pulls in 5 packages in total once its runtime tree is resolved totalling about 4.5 MB on disk.

What license is magicast released under?

magicast is distributed under the MIT license. Its dependency tree also includes: BSD-3-Clause, MIT.

How popular is magicast?

magicast has approximately 33,856,256 downloads per week and 3 known dependent packages.

Is magicast still maintained?

The most recent release of magicast (v0.5.4) was published 1 month ago.

Does magicast run install scripts?

No. magicast does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.