Recursively read a directory and return an array of all file paths
90
{
"context": "This criteria evaluates how effectively an engineer uses the fs-readdir-recursive package to implement a directory scanner with robust edge case handling. The focus is exclusively on proper usage of the package's built-in capabilities for handling non-existent directories, empty directories, and recursive traversal.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Uses fs-readdir-recursive",
"description": "Solution imports and uses the fs-readdir-recursive package (typically via require('fs-readdir-recursive')) rather than implementing custom directory reading logic with fs.readdirSync or other methods.",
"max_score": 30
},
{
"name": "Leverages built-in edge case handling",
"description": "Solution relies on fs-readdir-recursive's built-in behavior of returning an empty array for non-existent directories, rather than adding explicit error handling with try-catch blocks or fs.existsSync checks.",
"max_score": 25
},
{
"name": "Correct function invocation",
"description": "Solution correctly calls the fs-readdir-recursive function with the directory path as the first parameter, using the proper function signature read(dirPath) or read(dirPath, filter).",
"max_score": 20
},
{
"name": "Returns relative paths",
"description": "Solution returns the array of relative file paths directly as provided by fs-readdir-recursive, without unnecessarily transforming them to absolute paths or modifying the path format.",
"max_score": 15
},
{
"name": "Minimal implementation",
"description": "Solution takes advantage of fs-readdir-recursive's built-in recursive traversal and filtering, avoiding reimplementation of recursive logic, custom filtering for subdirectories, or manual path construction.",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-fs-readdir-recursive