Installation
Package Manager
ChunkFlow supports all major package managers. Choose the one you prefer:
pnpm (Recommended)
pnpm add @chunkflowjs/corenpm
npm install @chunkflowjs/coreyarn
yarn add @chunkflowjs/corebun
bun add @chunkflowjs/corePackage Selection
Choose the packages based on your needs:
Minimal Setup (Core Only)
For vanilla JavaScript or custom integrations:
pnpm add @chunkflowjs/coreReact Setup
For React applications with ready-to-use components:
pnpm add @chunkflowjs/core @chunkflowjs/upload-client-react @chunkflowjs/upload-component-reactVue Setup
For Vue applications with ready-to-use components:
pnpm add @chunkflowjs/core @chunkflowjs/upload-client-vue @chunkflowjs/upload-component-vueServer Setup
For Node.js server implementation:
pnpm add @chunkflowjs/upload-serverFull Stack Setup
For complete client and server setup:
# Client
pnpm add @chunkflowjs/core @chunkflowjs/upload-client-react @chunkflowjs/upload-component-react
# Server
pnpm add @chunkflowjs/upload-serverTypeScript Support
All ChunkFlow packages are written in TypeScript and include type definitions out of the box. No additional @types packages are needed.
Browser Support
ChunkFlow supports all modern browsers:
- Chrome/Edge 90+
- Firefox 88+
- Safari 14+
Required Browser APIs
ChunkFlow uses the following browser APIs:
- File API: For reading files
- Fetch API: For HTTP requests (or you can provide a custom adapter)
- IndexedDB: For resumable upload persistence (optional, gracefully degrades)
- Web Workers: For hash calculation (optional, falls back to main thread)
Node.js Support
For server-side usage:
- Node.js 18+
- Bun 1.0+
CDN Usage
You can also use ChunkFlow via CDN for quick prototyping:
<script type="module">
import { UploadManager } from "https://esm.sh/@chunkflowjs/core";
// Your code here
</script>WARNING
CDN usage is not recommended for production. Use a package manager for better performance and reliability.
Monorepo Setup
If you're using a monorepo (pnpm workspace, npm workspaces, yarn workspaces, or Turborepo), ChunkFlow works seamlessly:
{
"dependencies": {
"@chunkflowjs/core": "workspace:*",
"@chunkflowjs/upload-client-react": "workspace:*"
}
}Verification
After installation, verify that ChunkFlow is installed correctly:
import { UploadManager } from "@chunkflowjs/core";
console.log(UploadManager); // Should output the class constructorTroubleshooting
Module Not Found
If you encounter "Module not found" errors:
Clear your package manager cache:
bashpnpm store prune # pnpm npm cache clean --force # npm yarn cache clean # yarnDelete
node_modulesand reinstall:bashrm -rf node_modules pnpm install
TypeScript Errors
If you encounter TypeScript errors:
Ensure your
tsconfig.jsonincludes:json{ "compilerOptions": { "moduleResolution": "bundler", "module": "ESNext", "target": "ES2020" } }Clear TypeScript cache:
bashrm -rf node_modules/.cache
Build Errors
If you encounter build errors with Vite, Webpack, or other bundlers:
- Ensure you're using ESM imports
- Check that your bundler supports the
exportsfield inpackage.json - Update your bundler to the latest version
Next Steps
Now that you have ChunkFlow installed, check out the Getting Started guide to begin using it in your project.
