The tmp package with promises support and disposers.
93
Build a batch file processor that processes multiple input files, creates temporary files for intermediate results, and ensures all temporary resources are cleaned up even if the process crashes or is interrupted.
Your task is to create a Node.js application that:
Create a module that exports a processBatch function with the following behavior:
inputDir (directory containing input files) and outputPath (path for final output).txt files from the input directory/**
* Processes batch files from input directory and combines results.
*
* @param {string} inputDir - Directory containing input .txt files
* @param {string} outputPath - Path for the combined output file
* @returns {Promise<void>}
*/
async function processBatch(inputDir, outputPath) {
// Implementation
}
module.exports = { processBatch };@generates
Provides temporary file creation and automatic cleanup functionality.
@satisfied-by
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