Back to Explore

sindresorhus/ansi-escapes

GitHub1 watchersOpen source

Last release:

This software provides ANSI escape codes for manipulating a terminal, including cursor movement, screen and line erasing, scrolling, and clearing terminal or viewport content. It is useful for developers who need to write terminal control sequences directly to stdout, including support for use in the browser with Xterm.js.

Project status

  • Actively maintained, with a recent update on 2026-02-04 (v7.3.0), which is only about 6 months before today (2026-08-12).
  • Updates appear moderately frequent, with v7.3.0 in Feb 2026, v7.2.0 in Nov 2025 (about 3 months earlier), and v7.1.1 in Sep 2025 (about 6 weeks before v7.2.0).

AI summary generated

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

Recent updates

  • v7.3.0

    v7.3.0 adds support for terminal synchronized output escape sequences to reduce flicker during renders. It introduces new exports for beginning and ending synchronized output, plus a helper to wrap text in the sequence.

    Features
  • v7.2.0

    v7.2.0 adds special handling for OSC sequences when running under tmux, ensuring they are emitted in a format tmux accepts. It also adjusts terminal control code behavior on Windows based on OS version to better support ANSI escape sequences on newer Windows.

    Features
  • v7.1.1

    v7.1.1 is a small release focused on improving compatibility of the `image()` escape sequence with xterm.js. The only functional code change is in how the image escape string is constructed, plus minor type definition formatting updates.

  • v7.1.0

    v7.1.0 adds a new viewport-only clear escape sequence (clearViewport) intended to be safer than clearScreen, plus ConEmu current-working-directory support. It also introduces a new top-level setCwd helper that emits both iTerm2 and ConEmu CWD escape sequences. No existing exports were removed, and most changes are additive.

    Features
  • v7.0.0

    v7.0.0 primarily modernizes the package by requiring Node.js 18 and introducing named exports alongside the existing default export. The implementation was refactored so that the API surface now comes from a new internal module (base.js), and the package adds a new runtime dependency (environment).

    BreakingFeatures
  • v6.2.1

    v6.2.1 is a small maintenance release focused on TypeScript 5.4 compatibility. The code diff shows the fix is implemented in the type definitions (index.d.ts) by inlining a type-fest helper, along with some packaging and workflow metadata updates.

  • v6.2.0

    v6.2.0 adds new ANSI escape code strings for switching into and out of the terminal alternative screen. The change includes updated TypeScript typings, tests, and README documentation to match the new exports.

    Features
  • v6.1.0

    v6.1.0 adds explicit browser support for ansi-escapes (notably for use with xterm.js) by guarding Node-only APIs like process.cwd and process.platform. The code changes focus on environment detection (browser vs Node) and updating a couple of behaviors that previously depended on process.

    Features
  • v6.0.0

    This v6.0.0 release primarily updates the package to require a newer Node.js runtime and bumps dependencies. The code changes are mostly refactors and formatting adjustments, but there is at least one TypeScript type-level change that can affect consumers.

    Breaking
  • v5.0.0

    v5.0.0 makes ansi-escapes a pure ESM package and raises the supported Node.js version to 12+. The release notes only mention these two breaking items, but the diff also shows changes to how the module is exported in JavaScript and TypeScript typings.

    Breaking