magic-string
npmv1.2.3TypeScriptModify 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.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Licenses in the dependency tree
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.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| magic-stringthis page | 0 | 11 | MIT | 14 days ago |
| escape-string-regexp | 316.5M | 8 | MIT | 1 day ago |
| is-glob | 137.4M | 3 | MIT | 1 day ago |
| camelcase | 95.7M | 2 | MIT | 1 day ago |
| indent-string | 94M | 2 | MIT | 1 day ago |
| get-east-asian-width | 69.3M | 1 | MIT | 1 day ago |
Dependencies
Declared by magic-string v1.2.3. Runtime dependencies are installed with the package; dev dependencies are not.
Runtime (1)
Dev (13)
Used by
Popular packages that depend on magic-string.
Native-ESM powered web dev build tool
A utility-first CSS framework for rapidly building custom user interfaces.
Next generation testing framework powered by Vite
Minimal H(TTP) framework built for high performance and portability.
AST-aware v8-to-istanbul
Cybernetically enhanced web apps
A bson parser for node.js and the browser
Vitest snapshot manager
Vitest module mocker implementation
Browser running for Vitest
@vue/compiler-sfc
Relationship graph
Dependencies (left) and dependents (right) of magic-string.
Frequently installed together
TypeScript definitions for node
An extremely fast JavaScript and CSS bundler and minifier.
Native-ESM powered web dev build tool
Next generation testing framework powered by Vite
Shared Vitest utility functions
Universal filesystem path utils
Trace the original position through a source map
TypeScript definitions for estree
A fast and minimal alternative to globby and fast-glob
Traverse an ESTree-compliant AST
Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. It includes many web standards from WHATWG DOM and HTML.
Cross-platform WebSocket Servers for Node.js, Deno, Bun and Cloudflare Workers
Release history
13 releases in the last two years, typically about 14 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 1.2.3latest | 14 days ago | 72 KB | MIT |
| 1.2.2 | 21 days ago | 71 KB | MIT |
| 1.2.1 | 22 days ago | 71 KB | MIT |
| 1.2.0 | 28 days ago | 70 KB | MIT |
| 1.1.1 | 29 days ago | 69 KB | MIT |
| 1.1.0 | 1 month ago | 66 KB | MIT |
| 1.0.0 | 1 month ago | 151 KB | MIT |
| 0.30.21 | 10 months ago | 449 KB | MIT |
| 0.30.19 | 1 year ago | 449 KB | MIT |
| 0.30.18 | 1 year ago | 446 KB | MIT |
| 0.30.17 | 1 year ago | 457 KB | MIT |
| 0.30.16 | 1 year ago | 457 KB | MIT |
| 0.30.15 | 1 year ago | 454 KB | MIT |
| 0.30.14 | 1 year ago | 454 KB | MIT |
| 0.30.13 | 1 year ago | 454 KB | MIT |
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
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.