jsesc takes input data and returns the shortest possible stringified, printable-ASCII-only representation by escaping characters using JavaScript string escape sequences. It is useful as an alternative to JSON.stringify for generating JavaScript-friendly output that avoids encoding issues (for example, mojibake) when handling Unicode characters.
Project status
- Active maintenance: The source shows a recent tagged update (v3.1.0 on 2024-12-11), indicating it is not fully abandoned, but there is no evidence of ongoing updates after Dec 2024 (as of 2026-09-10), so maintenance appears light/quiet rather than fast-moving.
- Update cadence: The update history is sparse, with a large gap from 2020-10-28 (v3.0.2) to 2024-12-11 (v3.1.0), suggesting an infrequent cadence rather than regular releases or continuous development.
AI summary generated
Recent updates
v3.1.0
This release adds support for serializing JavaScript BigInt values in jsesc, including formatting under the existing numeric output modes (decimal, hex, binary, octal). The code also adjusts how BigInt is handled in JSON mode by converting BigInt to Number before JSON stringification.
BreakingFeaturesv3.0.2
Release v3.0.2 contains only small code adjustments plus version bumps. No release notes were provided, so the behavioral change (around Buffer detection) is not documented.
v3.0.1
Release v3.0.1 was published on 2020-04-09, but the publisher did not provide any release notes. As a result, there is not enough information to identify new features, bug fixes, breaking changes, security updates, or migration guidance for this version.
v3.0.0
v3.0.0 has no publisher release notes, but the diff shows a major internal refactor of jsesc string escaping. The most impactful change is new surrogate handling behavior in the core string escaping path, plus an increased supported Node.js version requirement.
Breakingv2.5.2
v2.5.2 makes a targeted change to the ASCII character whitelist used by jsesc when deciding which characters can remain unescaped. The update specifically affects handling of the backtick character, and the test suite was adjusted to reflect the new escaping behavior.
v2.5.1
Release v2.5.1 contains no publisher-provided release notes. The code diff shows multiple behavioral changes in jsesc output formatting, most notably new support for template-literal quoting (quotes: "backtick") and a changed Buffer stringification format (Buffer.from instead of Buffer()).
Featuresv2.4.0
Release v2.4.0 introduces a new `minimal` option to control how `jsesc` escapes characters, with behavior focused on handling only specific Unicode separator characters. The release notes section is empty, so the only authoritative record here is the code diff and accompanying README/test updates.
Featuresv2.3.0
Release v2.3.0 of jsesc updates the HTML/script-context escaping behavior. The release notes section is empty, but the code and docs show a breaking option rename and an expanded escaping rule.
v2.2.0
Release v2.2.0 introduces support for stringifying Node.js Buffer instances using jsesc. The README and test suite were updated accordingly, but the release notes contain no documented changes.
BreakingFeaturesv2.1.0
Release v2.1.0 was published on 2016-05-31, but no release notes were provided by the publisher. As a result, there is no documented information about features, bug fixes, breaking changes, or security updates in the release notes.