Back to Explore

mathiasbynens/jsesc

GitHub
1 watchersOpen source

Last release: 12/11/2024

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

  • Likely actively maintained at least recently, with an update as late as 2024-12-11 (v3.1.0), but the overall history shows long gaps since earlier updates (for example, v3.0.1 in 2020 and v3.0.2 in 2020), so sustained near-term cadence is unclear.
  • Apparent update cadence is sparse, with a major gap of several years between v3.0.x in 2020 and v3.1.0 in 2024, suggesting an intermittent maintenance pattern rather than frequent iterations.

AI summary generated Today

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v3.1.0

    12/11/2024

    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.

    BreakingFeatures
  • v3.0.2

    10/28/2020

    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

    4/9/2020

    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

    4/8/2020

    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.

    Breaking
  • v2.5.2

    11/8/2018

    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

    5/4/2017

    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()).

    Features
  • v2.4.0

    12/27/2016

    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.

    Features
  • v2.3.0

    12/10/2016

    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

    6/7/2016

    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.

    BreakingFeatures
  • v2.1.0

    5/31/2016

    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.