NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #126 most downloaded on npm
Modify strings, generate sourcemaps
Last release 7 days ago
23 Sep 2026
Ships unpredictably
gaps range from 2 weeks to 9 months
Nearly every release is documented
notes for 55 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
136 releases · first in 2014
contentOnly and storeName are both optional
contentOnly and storeName are both optional* Add original to TS definitions
original to TS definitions* Avoid declare module
declare module (#127)One column per quarter.
* Update TypeScript definitions
Prevent overwrite state corruption
Clone indentExclusionRanges correctly
Add default property referencing self in index-legacy.js, to work around TypeScript bug
default property referencing self in index-legacy.js, to work around TypeScript bug (#121)* Add typings file to package
* Add TypeScript bindings
The fourth argument to overwrite is a {storeName, contentOnly} options object. storeName: true is equivalent to true before. contentOnly will preserve
overwrite is a {storeName, contentOnly} options object. storeName: true is equivalent to true before. contentOnly will preserve existing appends/prepends to the chunk in questionPrevent overwrites across a split point (i.e. following a move)
move)remove separately to overwriteMore accurate bundle sourcemaps
Optimisation – remove empty chunks following overwrite or remove
overwrite or remove (#113)insertLeft and insertRight are deprecated in favour of appendLeft and prependRight respectively
appendLeft, appendRight, prependLeft, prependRight methods (#109)insertLeft and insertRight are deprecated in favour of appendLeft and prependRight respectivelyInclude inserts in range for overwrite and remove operations
Generate correct bundle sourcemap with prepended/appended content
* Minor sourcemap fixes
Use named export of Bundle in ES build, so ES consumers of magic-string can tree-shake it out
Bundle in ES build, so ES consumers of magic-string can tree-shake it outThrow if overwrite of zero-length range is attempted
* Fix a bevy of s.slice() issues
s.slice() issues (#62)Breaking: insertAfter is now insertLeft, insertBefore is now insertRight
insertAfter is now insertLeft, insertBefore is now insertRightinsert is no longer available. Use insertLeft and insertRightFix sourcemap generation with insertAfter and insertBefore
insertAfter and insertBeforeAdd insertAfter and insertBefore methods
insertAfter and insertBefore methodsFix two regression bugs with trim()
trim()Fix trim methods to ensure correct sourcemaps with trimmed content
Support sourcemaps with moved content
Use findIndex helper for 0.12 support
findIndex helper for 0.12 supportRefactor internals to support move()
move() methodmove()Nothing published for this version
Do not overwrite inserts at the end of patched ranges
Zero-length inserts are not removed on adjacent overwrites
Breaking – magicString.locate and locateOrigin are deprecated
magicString.locate and locateOrigin are deprecatedmagicString.slice(...)* Update deps
* Update build process
Add an ES6 build, change default UMD build to CommonJS (but keeping existing UMD build with bundled dependencies)
The names array is populated when generating sourcemaps, and mappings include name indices where appropriate
Adjust mappings correctly when removing replaced content
Fix jsnext:main in package.json
jsnext:main in package.jsonFix bug with positive integer coercion
Intro content is correctly indented
Noop indents are still chainable (fixes bug introduced in 0.6.1)
Indenting with an empty string is a noop
Use rollup for bundling, instead of esperanto
Correct sourcemap generation with bundles containing varied separators
s.clone() clones indent exclusion ranges and sourcemap locationsAllow bundle separator to be the empty string
s.replace() is deprecated in favour of s.overwrite() (identical signature)
s.replace() is deprecated in favour of s.overwrite() (identical signature)bundle.addSource() can take a MagicString instance as its sole argument, for convenienceoptions in new MagicString(str, options) can include filename and indentExclusionRanges options, which will be used when bundlings.snip( start, end )file option is optional when generating a bundle sourcemap
file option is optional when generating a bundle sourcemapNothing published for this version
Repeated insertions at position 0 behave the same as other positions
Overlapping ranges can be removed
Implement source.addSourcemapLocation()
source.addSourcemapLocation()Another Windows fix, this time for file paths when bundling
Handle Windows-style CRLF newlines when determining whether a line is empty
Fix typo in package.json (d'oh again)
Includes correct files in npm package (d'oh)
Using experimental Esperanto feature (esperantojs/esperanto#68) to generate version with vlq dependency included
vlq dependency includedFixes a bug whereby multiple insertions at the same location would cause text to repeat
Breaking change - source.indentStr is null if no lines are indented. Use source.getIndentString() for the old behaviour (guess, and if no lines are in…
source.indentStr is null if no lines are indented. Use source.getIndentString() for the old behaviour (guess, and if no lines are indented, return \t)bundle.getIndentString() ignores sources with no indented lines when guessing indentation (#3)source.trimLines() removes empty lines from start/end of source, leaving other whitespace untouched
source.trimLines() removes empty lines from start/end of source, leaving other whitespace untouchedPerformance improvement - adjustments are only made when necessary
Your coding agent can read these notes before it upgrades. Set up the MCP server →