CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-arg

Unopinionated, no-frills CLI argument parser for Node.js applications

Overall
score

99%

Overview
Eval results
Files

rubric.jsonevals/scenario-9/

{
  "context": "This criteria evaluates how well the engineer uses the arg package to parse numeric command-line arguments, including the proper specification of Number type handlers and handling of various numeric formats.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Import arg package",
      "description": "Correctly imports the arg package (e.g., const arg = require('arg') or import arg from 'arg')",
      "max_score": 5
    },
    {
      "name": "Define specification object",
      "description": "Creates a specification object that maps argument names to the Number type constructor",
      "max_score": 15
    },
    {
      "name": "Use Number handler",
      "description": "Uses the built-in Number constructor as the type handler for all numeric arguments (--port, --timeout, --temperature)",
      "max_score": 25
    },
    {
      "name": "Call arg function",
      "description": "Calls the arg() function with the specification object and passes the custom argv array via options",
      "max_score": 15
    },
    {
      "name": "Integer parsing",
      "description": "Correctly parses integer values from arguments like '--port 8080' and '--port=3000'",
      "max_score": 10
    },
    {
      "name": "Decimal parsing",
      "description": "Correctly parses decimal/float values from arguments like '--timeout 2.5' and '--timeout=1.75'",
      "max_score": 10
    },
    {
      "name": "Negative number parsing",
      "description": "Correctly parses negative numbers from arguments like '--temperature -5' and '--temperature=-15.5'",
      "max_score": 10
    },
    {
      "name": "Return parsed result",
      "description": "Returns the result object from arg() that contains the parsed numeric properties and the _ array",
      "max_score": 10
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-arg

tile.json