Unopinionated, no-frills CLI argument parser for Node.js applications
Overall
score
99%
{
"context": "This criteria evaluates the engineer's ability to use the arg package to parse command-line arguments while collecting positional and unrecognized arguments into the result._ array. The focus is on proper use of the permissive mode, specification object, and understanding of how positional argument collection works.",
"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 proper specification object with '--verbose' mapped to Boolean and '--config' mapped to String",
"max_score": 15
},
{
"name": "Use permissive mode",
"description": "Calls arg() with the permissive: true option to allow unrecognized arguments to be collected in result._",
"max_score": 25
},
{
"name": "Pass custom argv",
"description": "Correctly passes the argv parameter to arg() using the argv option (e.g., arg(spec, { argv, permissive: true }))",
"max_score": 15
},
{
"name": "Access result._",
"description": "Accesses the result._ property to retrieve the array of positional/unrecognized arguments",
"max_score": 20
},
{
"name": "Return complete result",
"description": "Returns an object containing both the parsed options and the positional arguments array (either returning the result directly or constructing an object with the necessary properties)",
"max_score": 10
},
{
"name": "Handle double-dash terminator",
"description": "The implementation correctly handles the -- terminator (this is automatic when using arg(), so the solution should work without special handling)",
"max_score": 10
}
]
}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