CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-wrap-ansi

Wordwrap a string with ANSI escape codes

Overall
score

100%

Overview
Eval results
Files

rubric.jsonevals/scenario-8/

{
  "context": "This criteria evaluates how effectively the engineer uses the wrap-ansi package to handle text wrapping while correctly calculating visual width and ignoring ANSI escape codes. The focus is on using the appropriate package functions and options to achieve proper terminal text formatting.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Uses wrapAnsi function",
      "description": "The solution imports and uses the wrapAnsi function (or default export) from the wrap-ansi package as the primary mechanism for text wrapping",
      "max_score": 30
    },
    {
      "name": "Passes column width",
      "description": "The columnWidth parameter is correctly passed as the second argument to wrapAnsi to control the maximum line width",
      "max_score": 15
    },
    {
      "name": "Handles hard wrapping",
      "description": "The solution uses the hard: true option to ensure long words that exceed the column width are broken across lines, preventing any line from exceeding the specified width",
      "max_score": 25
    },
    {
      "name": "Preserves ANSI codes",
      "description": "The solution correctly relies on wrap-ansi's built-in ANSI code preservation without attempting to manually strip, parse, or re-insert ANSI escape sequences",
      "max_score": 20
    },
    {
      "name": "Returns wrapped string",
      "description": "The solution returns the result from wrapAnsi directly (or with minimal processing) rather than implementing custom wrapping logic",
      "max_score": 10
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-wrap-ansi

tile.json