source: frontend/node_modules/sisteransi/readme.md

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 2.5 KB
Line 
1# sister ANSI [![Version](https://img.shields.io/npm/v/sisteransi.svg)](https://www.npmjs.com/package/sisteransi) [![Build Status](https://travis-ci.org/terkelg/sisteransi.svg?branch=master)](https://travis-ci.org/terkelg/sisteransi) [![Downloads](https://img.shields.io/npm/dm/sisteransi.svg)](https://www.npmjs.com/package/sisteransi)
2
3> Ansi escape codes faster than you can say "[Bam bam](https://www.youtube.com/watch?v=OcaPu9JPenU)".
4
5## Installation
6
7```
8npm install sisteransi
9```
10
11
12## Usage
13
14```js
15const ansi = require('sisteransi');
16// or const { cursor } = require('sisteransi');
17
18const p = str => process.stdout.write(str);
19
20// move cursor to 2, 1
21p(ansi.cursor.to(2, 1));
22
23// to up, one down
24p(ansi.cursor.up(2)+ansi.cursor.down(1));
25```
26
27## API
28
29### cursor
30
31#### to(x, y)
32Set the absolute position of the cursor. `x0` `y0` is the top left of the screen.
33
34#### move(x, y)
35Set the position of the cursor relative to its current position.
36
37#### up(count = 1)
38Move cursor up a specific amount of rows. Default is `1`.
39
40#### down(count = 1)
41Move cursor down a specific amount of rows. Default is `1`.
42
43#### forward(count = 1)
44Move cursor forward a specific amount of rows. Default is `1`.
45
46#### backward(count = 1)
47Move cursor backward a specific amount of rows. Default is `1`.
48
49#### nextLine(count = 1)
50Move cursor to the next line a specific amount of lines. Default is `1`.
51
52#### prevLine(count = 1)
53Move cursor to the previous a specific amount of lines. Default is `1`.
54
55#### left
56Move cursor to the left side.
57
58#### hide
59Hide cursor.
60
61#### show
62Show cursor.
63
64#### save
65
66Save cursor position.
67
68#### restore
69
70Restore cursor position.
71
72
73### scroll
74
75#### up(count = 1)
76Scroll display up a specific amount of lines. Default to `1`.
77
78#### down(count = 1)
79Scroll display down a specific amount of lines. Default to `1`.
80
81
82### erase
83
84#### screen
85Erase the screen and move the cursor the top left position.
86
87#### up(count = 1)
88Erase the screen from the current line up to the top of the screen. Default to `1`.
89
90#### down(count = 2)
91Erase the screen from the current line down to the bottom of the screen. Default to `1`.
92
93#### line
94Erase the entire current line.
95
96#### lineEnd
97Erase from the current cursor position to the end of the current line.
98
99#### lineStart
100Erase from the current cursor position to the start of the current line.
101
102#### lines(count)
103Erase from the current cursor position up the specified amount of rows.
104
105
106## Credit
107
108This is a fork of [ansi-escapes](https://github.com/sindresorhus/ansi-escapes).
109
110
111## License
112
113MIT © [Terkel Gjervig](https://terkel.com)
Note: See TracBrowser for help on using the repository browser.