# sisteransi

> ANSI escape codes for some terminal swag

Latest version **2.0.0** (published 2026-06-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install sisteransi
pnpm add sisteransi
yarn add sisteransi
bun add sisteransi
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2026-06-25 |
| First published | 2018-02-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20 |
| Dependencies | 0 |
| Unpacked size | 7.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 81 |
| Author | Terkel Gjervig |
| Maintainers | terkelg |
| Keywords | ansi, escape codes, escape, terminal, style |

## Links

- npm: https://www.npmjs.com/package/sisteransi
- Repository: https://github.com/terkelg/sisteransi
- Homepage: https://github.com/terkelg/sisteransi#readme
- Issues: https://github.com/terkelg/sisteransi/issues
- npm.io page: https://npm.io/package/sisteransi

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2026-06-25
- 1.0.5 — 2020-03-18
- 1.0.4 — 2019-11-10
- 1.0.3 — 2019-08-05
- 1.0.2 — 2019-07-04
- 1.0.1 — 2019-07-02
- 1.0.0 — 2018-08-18
- 0.1.1 — 2018-06-27
- 0.1.0 — 2018-02-22
- 0.0.0 — 2018-02-20

## README

# sister ANSI [![Version](https://img.shields.io/npm/v/sisteransi.svg)](https://www.npmjs.com/package/sisteransi) [![CI](https://github.com/terkelg/sisteransi/actions/workflows/ci.yml/badge.svg)](https://github.com/terkelg/sisteransi/actions/workflows/ci.yml) [![Downloads](https://img.shields.io/npm/dm/sisteransi.svg)](https://www.npmjs.com/package/sisteransi)

> Ansi escape codes faster than you can say "[Bam bam](https://www.youtube.com/watch?v=OcaPu9JPenU)".

## Installation

```
npm install sisteransi
```

> **Note:** `sisteransi` 2.0 is **ESM-only** and needs **Node.js >= 20**.
> `import` works on any Node 20+, and CommonJS can `require()` it on
> Node 20.19+ (where `require(esm)` is unflagged). Stay on the `1.x`
> line only if you're on older Node.
> (Contributing? The test suite runs the TypeScript source directly via
> Node's type stripping, so local development needs Node.js >= 22.)


## Usage

```js
import { cursor } from 'sisteransi';
// or grab everything: import * as ansi from 'sisteransi';

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

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

// up two, down one
p(cursor.up(2) + 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.


### clear

#### screen
Clear the terminal screen. (Viewport)


## Credit

This is a fork of [ansi-escapes](https://github.com/sindresorhus/ansi-escapes).


## License

MIT © [Terkel Gjervig](https://terkel.com)

---
_Source: https://npm.io/package/sisteransi · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
