Helpers¶
All helpers reside on blessed.helpers
or blessed
.
- merge(a, b) - Merge objects
a
andb
into objecta
. - asort(obj) - Sort array alphabetically by
name
prop. - hsort(obj) - Sort array numerically by
index
prop. - findFile(start, target) - Find a file at
start
directory with nametarget
. - escape(text) - Escape content's tags to be passed into
el.setContent()
. Example:box.setContent('escaped tag: ' + blessed.escape('{bold}{/bold}'));
- parseTags(text) - Parse tags into SGR escape codes.
- generateTags(style, text) - Generate text tags based on
style
object. - attrToBinary(style, element) - Convert
style
attributes to binary format. - stripTags(text) - Strip text of tags and SGR sequences.
- cleanTags(text) - Strip text of tags, SGR escape code, and leading/trailing whitespace.
- dropUnicode(text) - Drop text of any >U+FFFF characters.
Last update: February 22, 2020