You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

sisteransi

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sisteransi

ANSI escape codes for some terminal swag


Version published
Weekly downloads
23M
increased by0.95%
Maintainers
1
Install size
7.53 kB
Created
Weekly downloads
 

Package description

What is sisteransi?

The sisteransi npm package provides utilities for manipulating ANSI escape codes, which are used to control text formatting, color, and other output options on text terminals.

What are sisteransi's main functionalities?

Text Formatting

This feature allows you to format text with styles such as bold, italic, and underline using ANSI escape codes.

const sisteransi = require('sisteransi');
console.log(sisteransi.bold('This is bold text'));
console.log(sisteransi.italic('This is italic text'));
console.log(sisteransi.underline('This is underlined text'));

Text Color

This feature allows you to change the color of the text using ANSI escape codes. You can set the text to various colors like red, green, and blue.

const sisteransi = require('sisteransi');
console.log(sisteransi.red('This is red text'));
console.log(sisteransi.green('This is green text'));
console.log(sisteransi.blue('This is blue text'));

Background Color

This feature allows you to change the background color of the text using ANSI escape codes. You can set the background to various colors like red, green, and blue.

const sisteransi = require('sisteransi');
console.log(sisteransi.bgRed('This text has a red background'));
console.log(sisteransi.bgGreen('This text has a green background'));
console.log(sisteransi.bgBlue('This text has a blue background'));

Other packages similar to sisteransi

Readme

Source

sister ANSI Version Build Status Downloads

Ansi escape codes faster than you can say "Bam bam".

Installation

npm install sisteransi

Usage

const ansi = require('sisteransi');
// or const { cursor } = require('sisteransi');

const p = str => process.stdout.write(str);

// move cursor to 2, 1
p(ansi.cursor.to(2, 1));

// to up, one down
p(ansi.cursor.up(2)+ansi.cursor.down(1));

API

cursor

to(x, y)

Set the absolute position of the cursor. x0 y0 is the top left of the screen.

move(x, y)

Set the position of the cursor relative to its current position.

up(count = 1)

Move cursor up a specific amount of rows. Default is 1.

down(count = 1)

Move cursor down a specific amount of rows. Default is 1.

forward(count = 1)

Move cursor forward a specific amount of rows. Default is 1.

backward(count = 1)

Move cursor backward a specific amount of rows. Default is 1.

nextLine(count = 1)

Move cursor to the next line a specific amount of lines. Default is 1.

prevLine(count = 1)

Move cursor to the previous a specific amount of lines. Default is 1.

left

Move cursor to the left side.

hide

Hide cursor.

show

Show cursor.

save

Save cursor position.

restore

Restore cursor position.

scroll

up(count = 1)

Scroll display up a specific amount of lines. Default to 1.

down(count = 1)

Scroll display down a specific amount of lines. Default to 1.

erase

screen

Erase the screen and move the cursor the top left position.

up(count = 1)

Erase the screen from the current line up to the top of the screen. Default to 1.

down(count = 2)

Erase the screen from the current line down to the bottom of the screen. Default to 1.

line

Erase the entire current line.

lineEnd

Erase from the current cursor position to the end of the current line.

lineStart

Erase from the current cursor position to the start of the current line.

lines(count)

Erase from the current cursor position up the specified amount of rows.

Credit

This is a fork of ansi-escapes.

License

MIT © Terkel Gjervig

Keywords

FAQs

Package last updated on 18 Mar 2020

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc