🛠️ Worker-Based Content Scanning
The contentFinder function is an internal multi-threaded utility for CMS products.
Features
- Uses worker threads to scan directories concurrently.
- Tracks total content files and progress.
- Supports pause/resume events during scanning.
- Can stop early if a target content ID or channel is found.
- Writes output optionally to JSON for external processing.
Parameters
| Option | Type | Description |
|---|---|---|
ProductName |
string | Name of the product to scan |
find |
string | Target content ID(s) to search |
findChannel |
string | Target channel name to search |
OutputDir |
string | Directory to store output JSON |
WantOutput |
boolean | If true, writes results to file |
logs |
boolean | If true, logs progress info |
onProgress |
function | Callback on partial results or progress updates |
Example Usage
1await contentFinder({2 ProductName: 'CodeBuddy',3 WantOutput: true,4 find: 'D9.x.a.h',5 logs: true,6 onProgress: (data) => console.log('Progress:', data)7});