{"id":43002459,"url":"https://github.com/sunny-117/chunkflow","last_synced_at":"2026-02-04T08:01:42.711Z","repository":{"id":335251431,"uuid":"1144770688","full_name":"Sunny-117/chunkflow","owner":"Sunny-117","description":"🎉 A universal large file upload solution with chunked upload, resumable upload, and instant upload capabilities. | 通用的大文件上传解决方案，支持分片上传、断点续传和秒传功能","archived":false,"fork":false,"pushed_at":"2026-01-31T06:09:14.000Z","size":6523,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-31T17:38:51.055Z","etag":null,"topics":["chunk","fiber","file","http","large-file-upload","protocol","rust","turbo","upload","upload-client","upload-component","websocket"],"latest_commit_sha":null,"homepage":"https://sunny-117.github.io/chunkflow/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sunny-117.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-29T03:04:02.000Z","updated_at":"2026-01-31T06:09:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"88cc0d40-376c-4cb6-baa1-50f3ff13e6c1","html_url":"https://github.com/Sunny-117/chunkflow","commit_stats":null,"previous_names":["sunny-117/chunkflow"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/Sunny-117/chunkflow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sunny-117%2Fchunkflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sunny-117%2Fchunkflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sunny-117%2Fchunkflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sunny-117%2Fchunkflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sunny-117","download_url":"https://codeload.github.com/Sunny-117/chunkflow/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sunny-117%2Fchunkflow/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28968718,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T04:44:20.970Z","status":"ssl_error","status_checked_at":"2026-02-01T04:44:19.994Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chunk","fiber","file","http","large-file-upload","protocol","rust","turbo","upload","upload-client","upload-component","websocket"],"created_at":"2026-01-31T04:09:42.649Z","updated_at":"2026-02-01T05:01:13.553Z","avatar_url":"https://github.com/Sunny-117.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./assets/logo.png\" alt=\"ChunkFlow Logo\" width=\"300\" height=\"300\" /\u003e\n  \u003ch1\u003eChunkFlow Upload SDK\u003c/h1\u003e\n  \u003cp\u003e\n    \u003cstrong\u003eA Universal Large File Upload Solution\u003c/strong\u003e\n  \u003c/p\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://www.npmjs.com/package/@chunkflowjs/core\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@chunkflowjs/core.svg\" alt=\"npm version\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/Sunny-117/chunkflow/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\" alt=\"license\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/Sunny-117/chunkflow\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/Sunny-117/chunkflow.svg?style=social\" alt=\"GitHub stars\"\u003e\u003c/a\u003e\n  \u003c/p\u003e\n  \u003cp\u003e\n    \u003ca href=\"./README.md\"\u003eEnglish\u003c/a\u003e | \u003ca href=\"./README.zh-CN.md\"\u003e简体中文\u003c/a\u003e\n  \u003c/p\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://sunny-117.github.io/chunkflow/\"\u003e📖 Documentation\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n---\n\n## ✨ Features\n\n- 🚀 **Smart Upload Strategy** - Automatic selection between direct and chunked upload based on file size\n- 📦 **Dynamic Chunking** - Adaptive chunk size adjustment based on network conditions (similar to TCP slow start)\n- ⚡ **Instant Upload** - Hash-based deduplication for instant uploads (秒传)\n- 🔄 **Resumable Upload** - Continue uploads from where you left off with IndexedDB persistence\n- 🎯 **Framework Agnostic** - Core layer works with any framework\n- ⚛️ **React Support** - Hooks and components for React applications\n- 💚 **Vue Support** - Composables and components for Vue applications\n- �️ **Highly Extensible** - Plugin system for custom functionality\n- 🔒 **Type Safe** - Written in TypeScript with full type definitions\n- 🧪 **Well Tested** - Comprehensive unit and property-based tests\n\n## 📦 Packages\n\n### Core Packages\n\n- **[@chunkflowjs/protocol](./packages/protocol)** - Protocol layer with type definitions and API interfaces\n- **[@chunkflowjs/shared](./packages/shared)** - Shared utilities (event system, concurrency, file utils, storage)\n- **[@chunkflowjs/core](./packages/core)** - Core upload engine with state machine and task management\n\n### Client Packages\n\n- **[@chunkflowjs/upload-client-react](./packages/upload-client-react)** - React adapter with hooks\n- **[@chunkflowjs/upload-client-vue](./packages/upload-client-vue)** - Vue adapter with composables\n- **[@chunkflowjs/upload-component-react](./packages/upload-component-react)** - Ready-to-use React components\n- **[@chunkflowjs/upload-component-vue](./packages/upload-component-vue)** - Ready-to-use Vue components\n\n### Server Package\n\n- **[@chunkflowjs/upload-server](./packages/upload-server)** - Server-side SDK with storage adapters\n\n## 🚀 Quick Start\n\n### Installation\n\n```bash\n# For React projects\npnpm add @chunkflowjs/core @chunkflowjs/upload-client-react\n\n# For Vue projects\npnpm add @chunkflowjs/core @chunkflowjs/upload-client-vue\n```\n\n### React Usage\n\n```tsx\nimport { UploadProvider, useUpload } from \"@chunkflowjs/upload-client-react\";\nimport { createFetchAdapter } from \"@chunkflowjs/core\";\n\nconst adapter = createFetchAdapter({\n  baseURL: \"http://localhost:3000/api\",\n});\n\nfunction App() {\n  return (\n    \u003cUploadProvider requestAdapter={adapter}\u003e\n      \u003cUploadComponent /\u003e\n    \u003c/UploadProvider\u003e\n  );\n}\n\nfunction UploadComponent() {\n  const { upload, status, progress } = useUpload({\n    onSuccess: (fileUrl) =\u003e console.log(\"Upload complete:\", fileUrl),\n    onError: (error) =\u003e console.error(\"Upload failed:\", error),\n  });\n\n  return (\n    \u003cdiv\u003e\n      \u003cinput\n        type=\"file\"\n        onChange={(e) =\u003e {\n          const file = e.target.files?.[0];\n          if (file) upload(file);\n        }}\n      /\u003e\n      \u003cdiv\u003eStatus: {status}\u003c/div\u003e\n      \u003cdiv\u003eProgress: {progress.percentage}%\u003c/div\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\n### Vue Usage\n\n```html\n\u003cscript setup\u003e\n  import { useUpload } from \"@chunkflowjs/upload-client-vue\";\n\n  const { upload, status, progress } = useUpload({\n    onSuccess: (fileUrl) =\u003e console.log(\"Upload complete:\", fileUrl),\n    onError: (error) =\u003e console.error(\"Upload failed:\", error),\n  });\n\n  const handleFileChange = (event) =\u003e {\n    const file = event.target.files?.[0];\n    if (file) upload(file);\n  };\n\u003c/script\u003e\n\n\u003ctemplate\u003e\n  \u003cdiv\u003e\n    \u003cinput type=\"file\" @change=\"handleFileChange\" /\u003e\n    \u003cdiv\u003eStatus: {{ status }}\u003c/div\u003e\n    \u003cdiv\u003eProgress: {{ progress.percentage }}%\u003c/div\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n```\n\n## 🏗️ Architecture\n\nChunkFlow Upload SDK follows a layered architecture:\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                     Applications                             │\n│  Playground (Demo) │ Server (Nest.js) │ Website (Docs)      │\n└─────────────────────────────────────────────────────────────┘\n                            │\n┌─────────────────────────────────────────────────────────────┐\n│                     Component Layer                          │\n│  React Components │ Vue Components                           │\n└─────────────────────────────────────────────────────────────┘\n                            │\n┌─────────────────────────────────────────────────────────────┐\n│                     Client Adapter Layer                     │\n│  React Hooks │ Vue Composables                               │\n└─────────────────────────────────────────────────────────────┘\n                            │\n┌─────────────────────────────────────────────────────────────┐\n│                     Core Layer                               │\n│  Upload Manager │ Upload Task │ Plugin System                │\n└─────────────────────────────────────────────────────────────┘\n                            │\n┌─────────────────────────────────────────────────────────────┐\n│                     Shared Layer                             │\n│  Event System │ Concurrency │ File Utils │ Storage           │\n└─────────────────────────────────────────────────────────────┘\n                            │\n┌─────────────────────────────────────────────────────────────┐\n│                     Protocol Layer                           │\n│  Type Definitions │ API Interfaces                           │\n└─────────────────────────────────────────────────────────────┘\n```\n\n## 📚 Documentation\n\nFull documentation is available at: [https://sunny-117.github.io/chunkflow/](https://sunny-117.github.io/chunkflow/)\n\n## 🛠️ Development\n\nThis project uses a monorepo structure managed by pnpm workspaces and Turbo.\n\n### Prerequisites\n\n- Node.js \u003e= 18.0.0\n- pnpm \u003e= 9.0.0\n\n### Setup\n\n```bash\n# Install dependencies\npnpm install\n\n# Build all packages\npnpm build\n\n# Run tests\npnpm test\n\n# Lint code\npnpm lint\n\n# Format code\npnpm format\n```\n\n### Project Structure\n\n```\nchunkflow/\n├── packages/              # SDK packages\n│   ├── protocol/         # Protocol layer\n│   ├── shared/           # Shared utilities\n│   ├── core/             # Core upload engine\n│   ├── upload-client-react/    # React adapter\n│   ├── upload-client-vue/      # Vue adapter\n│   ├── upload-component-react/ # React components\n│   ├── upload-component-vue/   # Vue components\n│   └── upload-server/    # Server SDK\n├── apps/                 # Applications\n│   ├── server/          # Nest.js server\n│   ├── playground/      # Demo application\n│   └── website/         # Documentation site\n├── pnpm-workspace.yaml  # Workspace configuration\n├── turbo.json           # Turbo configuration\n└── package.json         # Root package.json\n```\n\n## 🧪 Testing\n\nThe project uses a dual testing approach:\n\n- **Unit Tests** - Test specific examples and edge cases\n- **Property-Based Tests** - Test universal properties across random inputs using fast-check\n\n```bash\n# Run all tests\npnpm test\n\n# Run tests in watch mode\npnpm test:watch\n\n# Run tests with coverage\npnpm test -- --coverage\n```\n\n## 🤝 Contributing\n\nContributions are welcome! Please read our [contributing guidelines](./CONTRIBUTING.md) before submitting a PR.\n\n## 📄 License\n\nMIT © [Sunny-117](https://github.com/Sunny-117)\n\n## 🙏 Acknowledgments\n\n- [mitt](https://github.com/developit/mitt) - Event emitter\n- [p-limit](https://github.com/sindresorhus/p-limit) - Concurrency control\n- [spark-md5](https://github.com/satazor/js-spark-md5) - MD5 hashing\n- [fast-check](https://github.com/dubzzz/fast-check) - Property-based testing\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003cp\u003eMade with ❤️ by \u003ca href=\"https://github.com/Sunny-117\"\u003eSunny-117\u003c/a\u003e\u003c/p\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://github.com/Sunny-117/chunkflow/stargazers\"\u003e⭐ Star us on GitHub\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunny-117%2Fchunkflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunny-117%2Fchunkflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunny-117%2Fchunkflow/lists"}