</>PackageGraphPackageGraph

magic-string

npmv1.2.3TypeScript

Modify strings, generate sourcemaps

Safe to adopt

Yes — magic-string scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 14 days ago. 16 releases in the last 2 years.

  • ?Adoption: grade ?, Not reported by this registry.

    No download data reported for this package yet.

  • AMaintenance: grade A, Excellent.

    Last published 14 days ago. 16 releases in the last 2 years.

  • AWeight: grade A, Excellent.

    Pulls in 1 transitive package, about 166 KB installed.

  • ASupply chain: grade A, Excellent.

    No install scripts, 4 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 magic-string to a project.

1
Direct dependencies

Runtime packages this one declares itself.

1
Total installed

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

166 KB
Install size

Unpacked size of this package plus its entire runtime tree.

1
Tree depth

Longest resolved dependency chain below this package.

Licenses in the dependency tree

MIT

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

Compatibility

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

Quick start

A usage example from the magic-string README.

<script type="module">
	import MagicString from 'https://unpkg.com/magic-string/dist/index.mjs';
</script>

magic-string vs the alternatives

Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.

PackageWeekly downloadsDependentsLicenseLast release
magic-stringthis page011MIT14 days ago
escape-string-regexp316.5M8MIT1 day ago
is-glob137.4M3MIT1 day ago
camelcase95.7M2MIT1 day ago
indent-string94M2MIT1 day ago
get-east-asian-width69.3M1MIT1 day ago

Dependencies

Declared by magic-string v1.2.3. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (13)

@antfu/eslint-config ^9.1.0@types/node ^26.1.1benchmark ^2.1.4bumpp ^11.1.0conventional-changelog ^8.1.0conventional-changelog-angular ^9.2.1eslint ^10.7.0publint ^0.3.21source-map-js ^1.2.1source-map-support ^0.5.21tsdown ^0.22.8typescript ~6.0.3vitest ^4.1.10

Used by

Popular packages that depend on magic-string.

Relationship graph

Dependencies (left) and dependents (right) of magic-string.

Frequently installed together

Release history

13 releases in the last two years, typically about 14 days apart.

Recent versions of magic-string
VersionPublishedSizeLicense
1.2.3latest14 days ago72 KBMIT
1.2.221 days ago71 KBMIT
1.2.122 days ago71 KBMIT
1.2.028 days ago70 KBMIT
1.1.129 days ago69 KBMIT
1.1.01 month ago66 KBMIT
1.0.01 month ago151 KBMIT
0.30.2110 months ago449 KBMIT
0.30.191 year ago449 KBMIT
0.30.181 year ago446 KBMIT
0.30.171 year ago457 KBMIT
0.30.161 year ago457 KBMIT
0.30.151 year ago454 KBMIT
0.30.141 year ago454 KBMIT
0.30.131 year ago454 KBMIT

Overview

magic-string is an npm package that modify strings, generate sourcemaps. It has 11 known dependents in the graph. The latest version is 1.2.3, released under the MIT license.

Who should use it

Teams working in the npm ecosystem who need modify strings, generate sourcemaps and value a focused solution.

When not to use it

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

Pros

  • Ships TypeScript type definitions.
  • Clear open-source license (MIT).

Cons

  • No significant drawbacks detected from available metadata.

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

Maintainers

Keywords

Frequently asked questions

Should I use magic-string?

Yes — magic-string scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 14 days ago. 16 releases in the last 2 years.

How do I install magic-string?

Run `npm install magic-string` to add magic-string to your npm project.

How many dependencies does magic-string have?

magic-string declares 14 direct dependencies and pulls in 1 packages in total once its runtime tree is resolved totalling about 166 KB on disk.

What license is magic-string released under?

magic-string is distributed under the MIT license.

How popular is magic-string?

npm does not publish download counts. Within PackageGraph's crawl, 11 known packages depend on magic-string.

Is magic-string still maintained?

The most recent release of magic-string (v1.2.3) was published 14 days ago.

Does magic-string run install scripts?

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