Unopinionated, no-frills CLI argument parser for Node.js applications
Overall
score
99%
{
"context": "This criteria evaluates how well the engineer uses the arg package's error handling capabilities, specifically the ArgError class with error codes and proper try-catch patterns for handling parsing and configuration errors.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Import arg package",
"description": "Correctly imports or requires the arg package to use its parsing functionality",
"max_score": 5
},
{
"name": "Define argument spec",
"description": "Creates a proper specification object for arg with --port mapped to Number, --name mapped to String, --verbose mapped to Boolean, and appropriate aliases (-p, -n, -v)",
"max_score": 15
},
{
"name": "Use arg() function",
"description": "Calls the arg() function with the specification object and custom argv parameter to parse command-line arguments",
"max_score": 10
},
{
"name": "Try-catch for errors",
"description": "Wraps the arg() function call in a try-catch block to catch ArgError instances thrown during parsing",
"max_score": 20
},
{
"name": "Access error.code",
"description": "Accesses the .code property of caught errors to distinguish between different error types (e.g., ARG_UNKNOWN_OPTION, ARG_MISSING_REQUIRED_LONGARG)",
"max_score": 25
},
{
"name": "Access error.message",
"description": "Accesses the .message property of caught errors to provide descriptive error information",
"max_score": 10
},
{
"name": "Return structured results",
"description": "Returns a consistent result object with success/error structure as specified in the API, including parsed arguments on success and error details on failure",
"max_score": 10
},
{
"name": "Handle unknown options",
"description": "Properly catches and handles ARG_UNKNOWN_OPTION errors when unknown arguments are passed without permissive mode",
"max_score": 5
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-argdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10