CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-workerpool

Offload tasks to a pool of workers on node.js and in the browser

Overall
score

95%

Overview
Eval results
Files

task.mdevals/scenario-9/

File Processor with Progress Tracking

A utility that processes text files in a worker pool and reports progress events during processing.

Capabilities

Processes files and emits progress events

  • Given an array ["file1.txt", "file2.txt"] where file1.txt contains "hello" and file2.txt contains "world", returns ["HELLO", "WORLD"] and emits a progress event for each file processed @test

Captures all progress events

  • When processing 3 files, exactly 3 progress events are emitted, one for each file @test

Implementation

@generates

API

/**
 * Processes an array of file paths, reading each file, converting its content
 * to uppercase, and emitting progress events for each file processed.
 *
 * @param {string[]} filePaths - Array of file paths to process
 * @returns {Promise<string[]>} Array of uppercase file contents
 */
async function processFiles(filePaths) {
  // IMPLEMENTATION HERE
}

module.exports = { processFiles };

Dependencies { .dependencies }

workerpool { .dependency }

Provides worker pool functionality for offloading tasks and emitting progress events.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-workerpool

tile.json