Build table headers from an array of key-value objects
the key-value objects from which to build headers
the headers array
Replace keys from an object with string explanations for those keys, primarily so that they can be printed for the user to read.
the original object e.g. a response from a z/OSMF API {wrdKy4U: "weirdkeyvalue"}
an object that maps the original to the new format
should keys not covered by the explanation object be included in the result?
Auto-detect whether a message should be formatted with printf-style formatting or mustache (but don't try to use both!) and format the string accordingly
the string message with %s or {{mustache}} style variables
the fields that will resolve the printf or mustache template
Get the recommended width to wrap text. You can specify a preferred width, but this method width return
the width you would like to use if supported by the user's terminal
the key-value objects to convert to a
the main color to highlight headings of the table with. e.g. "blue"
override the default column width of the table?
should the table include a header of the field names of the objects
should the table have borders between the cells?
hard wrap the text within the width of the table cells (defaults to false)
specify which headers in which order to display. if omitted, loops through the rows and adds object properties as headers in their enumeration order
the rendered table
Highlight all matches of a full regex with TextUtils.chalk
the text you'd like to search for matches
a regular expression of terms to highlight
Parse a key value string into an object
a string in the format key1=value1,key2=value2,key3=value3. Note: the key names are case sensitive
the parsed object
Get a json object in tabular form
use color on the result?
Render a mustache template based on arguments from the user
the mustache-style template string into which you would like to insert your values
a string in the format key1=value1,key2=value2,key3=value3. Note: the key names are case sensitive
Wrap some text so that it fits within a certain width with teh wrap-ansi package
The text you would like to wrap
The width you would like to wrap to - we'll try to determine the optimal width based on this (the resulting wrap may be wrapped to fewer columns, but not more)
Add this string to every line of the result
do not allow any letters past the requested width - defaults to false
Generated using TypeDoc
Lightweight utilities for text manipulation/coloring. Low import impact