The tmp package with promises support and disposers.
93
Build a function that processes data items in an isolated temporary workspace with automatic cleanup.
Implement a function processDataInWorkspace that:
The function accepts an array of data items (strings) and returns a promise that resolves to:
{
workspacePath: string, // Path of the temporary workspace used
processedData: string[] // Array of processed items
}@generates
/**
* Processes data items in a temporary workspace with automatic cleanup
* @param {string[]} dataItems - Array of data items to process
* @returns {Promise<{workspacePath: string, processedData: string[]}>}
*/
async function processDataInWorkspace(dataItems) {
// Implementation here
}
module.exports = { processDataInWorkspace };Provides temporary file and directory management with automatic cleanup support.
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