Wordwrap a string with ANSI escape codes
Overall
score
100%
A terminal message formatting utility that wraps and displays mixed content including styled text, emoji, and clickable hyperlinks to fit within specified column widths.
@generates
/**
* Formats a terminal message by wrapping it to a specified column width
* while preserving ANSI codes, emoji, and hyperlinks.
*
* @param {string} message - The message to format (may contain ANSI codes, emoji, hyperlinks)
* @param {number} columns - The maximum column width for wrapping
* @returns {string} The formatted message with preserved styling and functionality
*/
function formatMessage(message, columns) {
// IMPLEMENTATION HERE
}
module.exports = { formatMessage };Provides text wrapping with ANSI escape code support.
Install with Tessl CLI
npx tessl i tessl/npm-wrap-ansidocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10