🚀 Socket Launch Week 🚀 Day 5: Introducing Socket Fix.Learn More
Socket
Sign inDemoInstall
Socket

ansi-escapes

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ansi-escapes

ANSI escape codes for manipulating the terminal

7.0.0
latest
Source
npm
Version published
Weekly downloads
57M
-9.64%
Maintainers
1
Weekly downloads
 
Created

What is ansi-escapes?

The ansi-escapes npm package provides a collection of ANSI escape codes for manipulating the terminal. These codes can be used to control cursor movement, erase text, manage scrollback, and more, allowing developers to create interactive command-line applications.

What are ansi-escapes's main functionalities?

Cursor Movement

Moves the cursor to the specified x and y position (column 5, row 10).

const ansiEscapes = require('ansi-escapes');
console.log(ansiEscapes.cursorTo(5, 10));

Erase Lines

Erases the specified number of lines (2 lines in this case) from the current cursor position up.

const ansiEscapes = require('ansi-escapes');
console.log(ansiEscapes.eraseLines(2));

Scrolling

Scrolls the terminal viewport up or down one line.

const ansiEscapes = require('ansi-escapes');
console.log(ansiEscapes.scrollUp());
console.log(ansiEscapes.scrollDown());

Clearing Screen

Clears the terminal screen and moves the cursor to the upper-left corner.

const ansiEscapes = require('ansi-escapes');
console.log(ansiEscapes.clearScreen);

Beep

Triggers the terminal bell, which often makes an audible beep sound.

const ansiEscapes = require('ansi-escapes');
console.log(ansiEscapes.beep);

Other packages similar to ansi-escapes

Keywords

ansi

FAQs

Package last updated on 02 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts