Gathering detailed insights and metrics for ansi-escapes
Gathering detailed insights and metrics for ansi-escapes
Gathering detailed insights and metrics for ansi-escapes
Gathering detailed insights and metrics for ansi-escapes
supports-hyperlinks
Detect whether a terminal supports hyperlinks
bare-ansi-escapes
Parse and produce ANSI escape sequences
printable-characters
A little helper for handling strings containing zero width control characters, ANSI styling, whitespaces, newlines, 💩, etc.
jest-serializer-ansi-escapes
Jest snapshot serializer for ANSI escape sequences
npm install ansi-escapes
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (65.15%)
TypeScript (34.85%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
517 Stars
71 Commits
47 Forks
5 Watchers
1 Branches
16 Contributors
Updated on Jul 02, 2025
Latest Version
7.0.0
Package Id
ansi-escapes@7.0.0
Unpacked Size
17.43 kB
Size
5.43 kB
File Count
7
NPM Version
10.6.0
Node Version
20.12.2
Published on
May 02, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
4
ANSI escape codes for manipulating the terminal
1npm install ansi-escapes
1import ansiEscapes from 'ansi-escapes'; 2 3// Moves the cursor two rows up and to the left 4process.stdout.write(ansiEscapes.cursorUp(2) + ansiEscapes.cursorLeft); 5//=> '\u001B[2A\u001B[1000D'
Or use named exports...
1import {cursorUp, cursorLeft} from 'ansi-escapes'; 2 3// etc, as above...
You can also use it in the browser with Xterm.js:
1import ansiEscapes from 'ansi-escapes'; 2import {Terminal} from 'xterm'; 3import 'xterm/css/xterm.css'; 4 5const terminal = new Terminal({…}); 6 7// Moves the cursor two rows up and to the left 8terminal.write(ansiEscapes.cursorUp(2) + ansiEscapes.cursorLeft); 9//=> '\u001B[2A\u001B[1000D'
Set the absolute position of the cursor. x0
y0
is the top left of the screen.
Set the position of the cursor relative to its current position.
Move cursor up a specific amount of rows. Default is 1
.
Move cursor down a specific amount of rows. Default is 1
.
Move cursor forward a specific amount of columns. Default is 1
.
Move cursor backward a specific amount of columns. Default is 1
.
Move cursor to the left side.
Save cursor position.
Restore saved cursor position.
Get cursor position.
Move cursor to the next line.
Move cursor to the previous line.
Hide cursor.
Show cursor.
Erase from the current cursor position up the specified amount of rows.
Erase from the current cursor position to the end of the current line.
Erase from the current cursor position to the start of the current line.
Erase the entire current line.
Erase the screen from the current line down to the bottom of the screen.
Erase the screen from the current line up to the top of the screen.
Erase the screen and move the cursor the top left position.
Scroll display up one line.
Scroll display down one line.
Clear the terminal screen. (Viewport)
Clear the whole terminal, including scrollback buffer. (Not just the visible part of it)
Enter the alternative screen.
Exit the alternative screen, assuming enterAlternativeScreen
was called before.
Output a beeping sound.
Create a clickable link.
Supported terminals. Use supports-hyperlinks
to detect link support.
Display an image.
See term-img for a higher-level module.
Type: Buffer
Buffer of an image. Usually read in with fs.readFile()
.
Type: object
Type: string | number
The width and height are given as a number followed by a unit, or the word "auto".
N
: N character cells.Npx
: N pixels.N%
: N percent of the session's width or height.auto
: The image's inherent size will be used to determine an appropriate dimension.Type: boolean
Default: true
Type: string
Default: process.cwd()
Inform iTerm2 of the current directory to help semantic history and enable Cmd-clicking relative paths.
Creates an escape code to display an "annotation" in iTerm2.
An annotation looks like this when shown:
See the iTerm Proprietary Escape Codes documentation for more information.
Type: string
The message to display within the annotation.
The |
character is disallowed and will be stripped.
Type: object
Type: number
Default: The remainder of the line
Nonzero number of columns to annotate.
Type: number
Default: Cursor position
Starting X coordinate.
Must be used with y
and length
.
Type: number
Default: Cursor position
Starting Y coordinate.
Must be used with x
and length
.
Type: boolean
Default: false
Create a "hidden" annotation.
Annotations created this way can be shown using the "Show Annotations" iTerm command.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
security policy file detected
Details
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 11/30 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More