magic-string is a JavaScript utility for manipulating strings with surgical precision. It's particularly useful for source code transformation and manipulation tasks like minification or transpilation. Instead of directly modifying the original string, magic-string tracks changes, allowing you to accurately map modified content back to its original location and generate source maps. It provides methods for inserting, removing, and overwriting portions of a string, and can efficiently handle overlapping edits, ensuring you can transform code with confidence.
Magic-string's release frequency is highly variable. It had bursts of releases in 2014-2018, with a peak in November 2014 (14 versions). Release frequency significantly decreased after 2018, with many months having no releases. There were some small bursts in 2022, 2023 and 2024, mostly followed by periods of no releases. August 2025 had one release.
Magic-string's npm downloads show a steeply upward trend from March 2024 (83M) to August 2025 (240M). There is a significant drop in September 2025 (102M), but this number is incomplete, as the month is still ongoing. The peak was reached in July 2025, with 246M downloads.