The tmp package with promises support and disposers.
93
{
"context": "This criteria evaluates how well the engineer uses tmp-promise to implement automatic cleanup of temporary files in a batch processing application, with specific focus on the setGracefulCleanup() functionality.",
"type": "weighted_checklist",
"checklist": [
{
"name": "setGracefulCleanup() invocation",
"description": "The code calls setGracefulCleanup() to enable automatic cleanup of temporary files when the process exits. This should be called once at application initialization.",
"max_score": 40
},
{
"name": "Temporary file creation",
"description": "Uses tmp-promise methods (file(), withFile(), or fileSync()) to create temporary files for intermediate processing results.",
"max_score": 25
},
{
"name": "Proper async handling",
"description": "Uses the promise-based API correctly with async/await or .then() for asynchronous temporary file operations.",
"max_score": 15
},
{
"name": "File path usage",
"description": "Correctly accesses and uses the 'path' property from the temporary file object returned by tmp-promise methods to read/write temporary files.",
"max_score": 10
},
{
"name": "Appropriate cleanup strategy",
"description": "Relies on setGracefulCleanup() for automatic cleanup rather than manually calling cleanup() functions in this scenario, demonstrating understanding of when to use each approach.",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-tmp-promisedocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10