1.0.5 • Published 4 years ago

sisteransi v1.0.5

Weekly downloads
10,140,860
License
MIT
Repository
github
Last release
4 years ago

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

promptsarchetype-libraryeasy-select-rnreact-native-bluetooth2killi8n-react-native-fast-imagespecify-importsbabel-specify-imports@icanpm/api-masterreact-native-template-rfbaseairscanairscan-examplereact-native-esc-pos-sahaab@borisovart/atol-kkt-moduledeneme323112@texttree/demo-bsa-reference-rcl@ntt_app/react-native-custom-notificationreact-native-custom-text-hwjamesreact-native-covid-sdkgql_din_modbitget@saeon/ol-react@saeon/quick-form@olivervorasai/sliderreact-native-printer-brothersreact-native-shekhar-bridge-testwilscanner@oiti/documentoscopy-react-native@mink-opn/build-tokensquoc-testreact-native-slider-kfnursesastra-cli-kit@infinitebrahmanuniverse/nolb-sis@saaspe/componentsplginexpand-react-bridgeluminos-ui-coresklif-ui-kitsklif-api@everything-registry/sub-chunk-2771jawwy-sdkjawwy_gamification_release@314oner_npm/universal-components-libraryreact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgp149-tablesklif-uireact-native-jawwy_sample@geeky-apo/react-native-advanced-clipboardlib-errorhirahexyun.helpershot-zone-vuekhaled-salem-custom-componentsgogency-test-2gogencygoogle-remakelancetyersemproj3iex-sdkiris-colorsjinjujordy-frijters-test-libmooveemoonwalkerswap-default-token-listsnew-example-projectnka-gantt-task-reactnicholasbear_opensource_a1mobtimer-api2microend-componentmpesa-cookiempesa-cookie-jarhttp-mock-jsonjulien-easy-modaljrennsoh88-react-native-scroll-indicatornative-date-picker-modulenative-modal-damage-vehiclenative-kakao-loginnative-google-loginnative-apple-loginmy-library-buttonmy-greeter-packagemy-calc-boxnew-awesome-4321mama-exportermap-values-resolvernove-repositorynovacap-componentsnotion-database-exporternpm_qwertynpm_one_12_34_1_npm_one_1_2_3npm_one_2_2npm-package-mentorcheckmath-operation-funmavectramd-links-jivamd-links-cmdlinks-belen
1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.0

6 years ago