This library provides human / terminal interactions.
High level overview
Work with the application header. Set/resetting the header will clear the current screen content.
Methods for launching editors and menus to retrieve information from the user.
Icon translations for font awesome
Work with the cursor, print text, and buffered screen rendering.
Tools for formatting text
Pause, and wait for user interaction
Construct an array of objects that conform to a common definition.
Image | Description |
---|---|
Base view with 1 option | |
Actively editing a property of an object |
Request a true / false value from the user
Present a message to the user, and ask for yes / no confirmation
Build a date/time from user input. Can accept date in fuzzy formats, and granular
Image | Description |
---|---|
Fuzzy input method | |
Granular input method |
Highly configurable menu, with easy to configure keyboard interactions, and tons of features.
Construct a single flat object
Image | Description |
---|---|
Base view | |
With editor |
Select options out of a list.
Request text from the user
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
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.
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.
Render item count for menus and lists.
Render row count for tables
Utilize font awesome icons in prompts. Requires fontawesome to be installed on system
The default character width to render string prompt type backgrounds
Flags and switches that are intended to be used on the command line when launching the app.
# Usage example
node ./dist/apps/sampler-app/main.js --help
Scan the application for configuration options, and output a summary of items that can be configured via command line switches