23.47.2 • Published 5 months ago

@digital-alchemy/tty v23.47.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

@digital-alchemy/tty

Description

This library provides human / terminal interactions.

Exported Services

High level overview

ApplicationManagerService

Work with the application header. Set/resetting the header will clear the current screen content.

PromptService

Methods for launching editors and menus to retrieve information from the user.

IconService

Icon translations for font awesome

ScreenService

Work with the cursor, print text, and buffered screen rendering.

TextRenderingService

Tools for formatting text

Editors

Acknowledge

Pause, and wait for user interaction

example

Array Builder

Construct an array of objects that conform to a common definition.

ImageDescription
imgBase view with 1 option
imgActively editing a property of an object

Boolean

Request a true / false value from the user

example

Confirm

Present a message to the user, and ask for yes / no confirmation

example

Date / Time / Date Range

Build a date/time from user input. Can accept date in fuzzy formats, and granular

ImageDescription
Fuzzy input method
Granular input method

Menu

Highly configurable menu, with easy to configure keyboard interactions, and tons of features.

example

Object Builder

Construct a single flat object

ImageDescription
imgBase view
imgWith editor

Pick Many

Select options out of a list.

example

String

Request text from the user

Configuration options

The following configuration options are utilized by this library.

; default configuration
[libs.tty]
  DEFAULT_HEADER_FONT=ANSI Regular
  SECONDARY_HEADER_FONT=Pagga
  PAGE_SIZE=20
  TABLE_RENDER_ROWS=20
  USE_FONTAWESOME_ICONS=true
  DEFAULT_PROMPT_WIDTH=50

DEFAULT_HEADER_FONT

application.setHeader(PRIMARY, SECONDARY);

The figlet font to use with setHeader commands. This font will be used with the PRIMARY header in the above example.

SECONDARY_HEADER_FONT

application.setHeader(SECONDARY);
application.setHeader(PRIMARY, SECONDARY);

The figlet font to use with setHeader commands. This font will be used with the SECONDARY header in the above examples.

PAGE_SIZE

Render item count for menus and lists.

TABLE_RENDER_ROWS

Render row count for tables

USE_FONTAWESOME_ICONS

Utilize font awesome icons in prompts. Requires fontawesome to be installed on system

DEFAULT_PROMPT_WIDTH

The default character width to render string prompt type backgrounds

Switches

Flags and switches that are intended to be used on the command line when launching the app.

HELP

# Usage example
node ./dist/apps/sampler-app/main.js --help

Example result

Scan the application for configuration options, and output a summary of items that can be configured via command line switches

23.34.2

8 months ago

23.40.0

7 months ago

23.40.3

7 months ago

23.40.6

7 months ago

23.27.1

10 months ago

23.27.0

10 months ago

23.39.0

7 months ago

23.39.2

7 months ago

23.39.1

7 months ago

23.47.0

5 months ago

23.47.1

5 months ago

23.47.2

5 months ago

23.28.0

10 months ago

23.28.1

10 months ago

23.17.0

1 year ago

23.16.1

1 year ago

23.16.0

1 year ago

23.19.0

12 months ago

23.17.2

1 year ago

23.16.3

1 year ago

23.18.0

12 months ago

23.17.1

1 year ago

23.16.2

1 year ago

23.17.4

1 year ago

23.19.1

12 months ago

23.17.3

1 year ago

23.16.4

1 year ago

23.17.5

1 year ago

23.19.1-dev.0

12 months ago

23.19.1-dev.1

12 months ago

23.20.0

11 months ago

23.21.0

11 months ago

23.25.0

10 months ago

23.13.1

1 year ago

23.13.2

1 year ago

23.15.0

1 year ago

23.14.1

1 year ago

23.14.0

1 year ago

23.14.3

1 year ago

23.14.2

1 year ago

23.13.3

1 year ago

23.14.4

1 year ago

23.13.4

1 year ago

23.13.0

1 year ago

23.12.4

1 year ago

23.12.3

1 year ago

23.12.2

1 year ago

23.12.1

1 year ago

23.12.0

1 year ago