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-2/

{
  "context": "This criteria evaluates how well an engineer uses the wrap-ansi package to wrap text while preserving ANSI escape codes. The focus is on correctly utilizing the package's core wrapping function, understanding its ANSI preservation capabilities, and properly configuring wrapping behavior options.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Uses wrapAnsi function",
      "description": "Correctly imports and calls the wrapAnsi function (default export) to perform text wrapping",
      "max_score": 15
    },
    {
      "name": "Passes required parameters",
      "description": "Provides the required parameters to wrapAnsi: input string and column width (columns parameter)",
      "max_score": 10
    },
    {
      "name": "ANSI code preservation",
      "description": "Relies on wrapAnsi's built-in ANSI escape code preservation (doesn't attempt manual parsing or manipulation of escape codes)",
      "max_score": 25
    },
    {
      "name": "Hard wrapping option",
      "description": "Uses the 'hard' option in the wrapAnsi options parameter to enable hard wrapping when required (breaking long words at column boundaries)",
      "max_score": 20
    },
    {
      "name": "Handles wrapped output",
      "description": "Correctly handles the wrapped string output from wrapAnsi, which contains newline characters separating wrapped lines",
      "max_score": 15
    },
    {
      "name": "Test case coverage",
      "description": "Implements test cases that verify ANSI codes are preserved through wrapping, including colored text and multiple styles",
      "max_score": 15
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-wrap-ansi

tile.json