Wordwrap a string with ANSI escape codes
Overall
score
100%
{
"context": "This criteria evaluates how well the engineer uses wrap-ansi's hard wrapping optimization algorithm to minimize line breaks when wrapping text with long words that must be split across multiple lines.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Uses wrap-ansi package",
"description": "Implementation imports and uses the wrap-ansi package (typically imported as wrapAnsi or similar from 'wrap-ansi')",
"max_score": 20
},
{
"name": "Enables hard wrapping",
"description": "Calls wrapAnsi with the { hard: true } option to enable hard wrapping mode, which forces word breaks at column width",
"max_score": 25
},
{
"name": "Passes correct parameters",
"description": "Correctly passes the input string as first parameter and the width/columns value as second parameter to wrapAnsi",
"max_score": 15
},
{
"name": "Leverages optimization algorithm",
"description": "Relies on wrap-ansi's built-in optimization algorithm to automatically minimize line breaks (doesn't implement custom break calculation logic)",
"max_score": 25
},
{
"name": "Returns wrapped output",
"description": "Returns or outputs the result from wrapAnsi, which contains the optimally wrapped text with newlines",
"max_score": 15
}
]
}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