Socket
Socket
Sign inDemoInstall

ansi-escape-sequences

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ansi-escape-sequences

A simple library containing all known terminal ansi escape codes and sequences. Useful for adding colour to your command-line output or building a dynamic text user interface.


Version published
Weekly downloads
407K
increased by9.89%
Maintainers
1
Weekly downloads
 
Created

What is ansi-escape-sequences?

The ansi-escape-sequences npm package provides utilities for working with ANSI escape codes, which are used to control text formatting, color, and other output options on text terminals. This package allows you to easily add color, style, and control sequences to your terminal output.

What are ansi-escape-sequences's main functionalities?

Text Formatting

This feature allows you to format text with styles such as bold, italic, underline, etc. The code sample demonstrates how to make text bold.

const ansi = require('ansi-escape-sequences');
console.log(ansi.format('This is bold text', ['bold']));

Text Coloring

This feature allows you to colorize text with various colors. The code sample demonstrates how to make text red.

const ansi = require('ansi-escape-sequences');
console.log(ansi.format('This is red text', ['red']));

Cursor Control

This feature allows you to control the cursor position in the terminal. The code sample demonstrates how to move the cursor to a specific position before printing text.

const ansi = require('ansi-escape-sequences');
process.stdout.write(ansi.cursor.goto(10, 5));
console.log('Text at position (10, 5)');

Clearing the Screen

This feature allows you to clear parts or the entire terminal screen. The code sample demonstrates how to clear the entire screen.

const ansi = require('ansi-escape-sequences');
process.stdout.write(ansi.erase.display(2));

Other packages similar to ansi-escape-sequences

Keywords

FAQs

Package last updated on 01 Feb 2015

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc