Helpers¶
All helpers reside on blessed.helpers or blessed.
- merge(a, b) - Merge objects
aandbinto objecta. - asort(obj) - Sort array alphabetically by
nameprop. - hsort(obj) - Sort array numerically by
indexprop. - findFile(start, target) - Find a file at
startdirectory 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
styleobject. - attrToBinary(style, element) - Convert
styleattributes 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