ansi-escapes

  • Version 5.0.0
  • Published
  • 16.3 kB
  • 1 dependency
  • MIT license

Install

npm i ansi-escapes
yarn add ansi-escapes
pnpm add ansi-escapes

Overview

ANSI escape codes for manipulating the terminal

Index

Variables

variable ansiEscapes

const ansiEscapes: {
cursorTo(x: number, y?: number): string;
cursorMove(x: number, y?: number): string;
cursorUp(count?: number): string;
cursorDown(count?: number): string;
cursorForward(count?: number): string;
cursorBackward(count?: number): string;
cursorLeft: string;
cursorSavePosition: string;
cursorRestorePosition: string;
cursorGetPosition: string;
cursorNextLine: string;
cursorPrevLine: string;
cursorHide: string;
cursorShow: string;
eraseLines(count: number): string;
eraseEndLine: string;
eraseStartLine: string;
eraseLine: string;
eraseDown: string;
eraseUp: string;
eraseScreen: string;
scrollUp: string;
scrollDown: string;
clearScreen: string;
clearTerminal: string;
beep: string;
link(text: string, url: string): string;
image(buffer: any, options?: ImageOptions): string;
iTerm: {
setCwd(cwd?: string): string;
annotation(message: string, options?: AnnotationOptions): string;
};
};

    Interfaces

    interface AnnotationOptions

    interface AnnotationOptions {}

      property isHidden

      readonly isHidden?: boolean;
      • Create a "hidden" annotation.

        Annotations created this way can be shown using the "Show Annotations" iTerm command.

      property length

      readonly length?: number;
      • Nonzero number of columns to annotate.

        Default: The remainder of the line.

      property x

      readonly x?: number;
      • Starting X coordinate.

        Must be used with y and length.

        Default: The cursor position

      property y

      readonly y?: number;
      • Starting Y coordinate.

        Must be used with x and length.

        Default: Cursor position.

      interface ImageOptions

      interface ImageOptions {}

        property height

        readonly height?: LiteralUnion<'auto', number | string>;
        • The height is given as a number followed by a unit, or the word 'auto'.

          - N: N character cells. - Npx: N pixels. - N%: N percent of the session's width or height. - auto: The image's inherent size will be used to determine an appropriate dimension.

        property preserveAspectRatio

        readonly preserveAspectRatio?: boolean;

          property width

          readonly width?: LiteralUnion<'auto', number | string>;
          • The width is given as a number followed by a unit, or the word 'auto'.

            - N: N character cells. - Npx: N pixels. - N%: N percent of the session's width or height. - auto: The image's inherent size will be used to determine an appropriate dimension.

          Package Files (1)

          Dependencies (1)

          Dev Dependencies (4)

          Peer Dependencies (0)

          No peer dependencies.

          Badge

          To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

          You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/ansi-escapes.

          • Markdown
            [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/ansi-escapes)
          • HTML
            <a href="https://www.jsdocs.io/package/ansi-escapes"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>