@ionic/utils-terminal

  • Version 2.3.1
  • Published
  • 20.7 kB
  • 8 dependencies
  • MIT license

Install

npm i @ionic/utils-terminal
yarn add @ionic/utils-terminal
pnpm add @ionic/utils-terminal

Overview

Terminal utils for NodeJS

Index

Variables

variable CI_ENVIRONMENT_VARIABLES

const CI_ENVIRONMENT_VARIABLES: readonly string[];
  • These environment variables work for: GitHub Actions, Travis CI, CircleCI, Gitlab CI, AppVeyor, CodeShip, Jenkins, TeamCity, Bitbucket Pipelines, AWS CodeBuild

variable CI_ENVIRONMENT_VARIABLES_DETECTED

const CI_ENVIRONMENT_VARIABLES_DETECTED: string[];

    variable TERMINAL_INFO

    const TERMINAL_INFO: TerminalInfo;

      variable TTY_WIDTH

      const TTY_WIDTH: number;

        Functions

        function columnar

        columnar: (rows: string[][], { hsep, vsep, headers }: ColumnarOptions) => string;
        • Basic CLI table generator with support for ANSI colors.

          Parameter rows

          2-dimensional matrix containing cells. An array of columns, which are arrays of cells.

          Parameter

          options.vsep The vertical separator character, default is chalk.dim('|'). Supply an empty string to hide the separator altogether.

          Parameter

          options.hsep The horizontal separator character, default is chalk.dim('-'). This is used under the headers, if supplied. Supply an empty string to hide the separator altogether.

          Parameter

          options.headers An array of header cells.

        function expandPath

        expandPath: (p: string) => string;

          function generateFillSpaceStringList

          generateFillSpaceStringList: (
          list: string[],
          optimalLength?: number,
          fillCharacter?: string
          ) => string[];

            function indent

            indent: (n?: number) => string;

              function prettyPath

              prettyPath: (p: string) => string;

                function wordWrap

                wordWrap: (
                msg: string,
                { width, indentation, append }: WordWrapOptions
                ) => string;

                  Classes

                  class Cursor

                  class Cursor {}

                    property stream

                    static stream: any;

                      method hide

                      static hide: () => void;

                        method show

                        static show: () => void;

                          method toggle

                          static toggle: () => void;

                            class EscapeCode

                            class EscapeCode {}
                            • ANSI escape codes (WIP)

                              See Also

                              • https://en.wikipedia.org/wiki/ANSI_escape_code

                            property cursorBackward

                            static readonly cursorBackward: (count?: number) => string;

                              property cursorDown

                              static readonly cursorDown: (count?: number) => string;

                                property cursorForward

                                static readonly cursorForward: (count?: number) => string;

                                  property cursorHide

                                  static readonly cursorHide: () => string;

                                    property cursorLeft

                                    static readonly cursorLeft: () => string;

                                      property cursorShow

                                      static readonly cursorShow: () => string;

                                        property cursorUp

                                        static readonly cursorUp: (count?: number) => string;

                                          property eraseDown

                                          static readonly eraseDown: () => string;

                                            property eraseLine

                                            static readonly eraseLine: () => string;

                                              property eraseLines

                                              static readonly eraseLines: (count: number) => string;

                                                property eraseScreen

                                                static readonly eraseScreen: () => string;

                                                  property eraseUp

                                                  static readonly eraseUp: () => string;

                                                    Interfaces

                                                    interface ColumnarOptions

                                                    interface ColumnarOptions {}

                                                      property headers

                                                      headers?: string[];

                                                        property hsep

                                                        hsep?: string;

                                                          property vsep

                                                          vsep?: string;

                                                            interface TerminalInfo

                                                            interface TerminalInfo {}

                                                              property ci

                                                              readonly ci: boolean;
                                                              • Whether this is in CI or not.

                                                              property shell

                                                              readonly shell: string;
                                                              • Path to the user's shell program.

                                                              property tty

                                                              readonly tty: boolean;
                                                              • Whether the terminal is an interactive TTY or not.

                                                              property windows

                                                              readonly windows: boolean;
                                                              • Whether this is a Windows shell or not.

                                                              interface WordWrapOptions

                                                              interface WordWrapOptions {}

                                                                property append

                                                                append?: string;

                                                                  property indentation

                                                                  indentation?: number;

                                                                    property width

                                                                    width?: number;

                                                                      Package Files (5)

                                                                      Dependencies (8)

                                                                      Dev Dependencies (10)

                                                                      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/@ionic/utils-terminal.

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