A comprehensive collection of ANSI escape codes for terminal cursor control, screen manipulation, and advanced features.
ansi-escapes is a Node.js library that provides a comprehensive collection of ANSI escape codes for terminal manipulation. It solves the problem of working with low-level terminal control sequences by offering a clean, well-documented API for cursor movement, screen clearing, scrolling, and advanced terminal features. Developers can use it to create rich terminal applications with precise control over terminal behavior.
Node.js developers building CLI tools, terminal applications, or interactive command-line interfaces that require fine-grained control over terminal behavior. Also useful for developers working with Xterm.js in browser-based terminal emulators.
Developers choose ansi-escapes because it provides the most complete and well-documented collection of ANSI escape codes in a single package, with clear warnings about potentially destructive operations and safer alternatives. It's maintained by a reputable open-source author and works consistently across different terminal environments.
ANSI escape codes for manipulating the terminal
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Includes all standard ANSI codes for cursor movement, screen clearing, scrolling, and advanced features like alternative screens, as documented in the comprehensive API.
Works in Node.js and browser environments with Xterm.js, and provides specific integrations for iTerm2 and ConEmu, ensuring broad compatibility.
Offers safer alternatives like clearViewport over clearScreen, with clear warnings about potentially destructive operations, promoting robust terminal applications.
Supports creating clickable hyperlinks and displaying images directly in the terminal, enabling modern terminal interactions beyond plain text.
Advanced features like iTerm2 annotations and ConEmu directory setting are limited to specific terminals, reducing portability for applications targeting diverse environments.
Requires manual handling of escape sequences and terminal state, which can be error-prone compared to higher-level terminal UI libraries that abstract these details.
Even with warnings, methods like clearScreen can inadvertently clear scrollback buffers or reset terminal modes, posing risks if used incorrectly.