🇹🇼 中文說明(點擊展開)
Workr 是一個輕量級的通用後台任務佇列平台,專為視頻處理、圖片轉換等耗時任務設計。
- 🚀 輕量高效 — 純 Node.js 實現,無框架依賴
- 📦 多種任務類型 — 縮圖提取、WebP 轉換、HLS 轉碼、檔案下載
- ⚡ 優先級佇列 — 支援任務優先級排序
- 🔄 智能重試 — 指數退避重試機制
- 📡 即時更新 — SSE 推送任務進度
- 🔔 回調通知 — 任務完成自動通知
- 視頻平台的轉碼服務
- 圖片處理 pipeline
- 批量下載任務
- 任何需要後台處理的長時間任務
- Memory-based job queue
- Multiple job types: thumbnail, webp, hls, download
- Priority queue
- Auto retry with exponential backoff
- SSE progress updates
- Callback notifications
npm install
npm startcurl -X POST http://localhost:4002/api/jobs \
-H "Authorization: Bearer dev-key" \
-H "Content-Type: application/json" \
-d '{"type":"thumbnail","payload":{"videoPath":"/path/to/video.mp4","outputPath":"/path/to/thumb.webp"}}'curl http://localhost:4002/api/jobs/job_xxx \
-H "Authorization: Bearer dev-key"curl http://localhost:4002/api/jobs \
-H "Authorization: Bearer dev-key"| Type | Description |
|---|---|
thumbnail |
Extract video thumbnail |
webp |
Convert image to WebP |
hls |
Transcode video to HLS |
download |
Download file with retry |
PORT=4002
WORKR_API_KEY=your-secret-key{
"id": "workr",
"repoUrl": "https://github.com/Jeffrey0117/workr.git",
"port": 4002
}