@atlaskit/chunkinator

中文文档
8.2.0发布于 2026/09/09Apache-2.0TypeScriptESM + CJS近 30 天下载 9.4万

Upload large files from the browser with ease

原始使用文档
文档目录5 节
  1. slicenator
  2. hashinator
  3. uploadinator
  4. processinator
  5. onProgress callback

chunkinator

Upload large files from the browser with ease

Pipeline pieces description

See examples/integrator.ts for good example of usage.

import {chunkinator} from '@atlaskit/chunkinator';

chunkinator is a main customizable high level component that gives you a way to upload large files. It takes a file as an input and pushes it through Observable pipe that consist of the following parts:

  • slicenator
  • hashinator
  • uploadinator
  • processinator

As a second argument chunkinator takes configuration options with following interface:

interface Options {
  chunkSize: number;
  hashingConcurrency: number;
  hashingFunction?: HashingFunction;
  uploadingConcurrency: number;
  uploadingFunction: UploadingFunction;
  processingBatchSize: number;
  processingFunction?: ProcessingFunction;
}

As a third argument chunkinator takes list of handy callbacks. Currently there is only one: onProgress.

slicenator

This component takes a blob, chunk size and returns Observable sequential stream of blob chunks.

Options' chunkSize is what defines chunk size

hashinator

This component takes stream of blobs and hashes each chunk. Returning stream contains blob and it's hash.

Options' hashingConcurrency defines how many chunks are hashed at the same time. hashingFunction is optional hashing function. If hashingFunction is not provided SHA-1 will be used instead.

uploadinator

This component takes hashed blobs and uploads them if blob doesn't exists on a backend.

Options' uploadingFunction is a callback that takes a blob and uploads it to the server. uploadingConcurrency controls how many of these calls happens at the same time.

processinator

With this component consumer has an opportunity to finalize already uploaded chunks in some way.

Options' processingFunction defines a function that is called with sequential batches of uploaded chunks. processingBatchSize controls how many uploaded chunks are given to processing function.

onProgress callback

This callback is called with every uploaded chunk. The only argument it is called with a portion of already uploaded chunks to it's total number.

版本与发布记录

@atlaskit/chunkinator 共发布 35 个版本,首次发布于 2020/04/20;过去 12 个月发布了 4 个版本。

版本发布日期距今
8.2.0latest2026/09/091 个月前
8.1.02026/08/302 个月前
8.0.02026/06/164 个月前
7.1.02026/04/286 个月前
7.0.02025/02/241.7 年前
6.2.02025/01/311.8 年前

其他发布通道:next → 4.2.2。

关于 @atlaskit/chunkinator 的常见问题

@atlaskit/chunkinator 是什么?

Upload large files from the browser with ease

如何安装 @atlaskit/chunkinator?

在项目目录运行 npm install @atlaskit/chunkinator,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^18.2.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@atlaskit/chunkinator 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@atlaskit/chunkinator 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@atlaskit/chunkinator 可以商用吗?

@atlaskit/chunkinator 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@atlaskit/chunkinator 的下载量有多少?

根据 npm 官方下载统计,@atlaskit/chunkinator 在 2026/10/07 – 2026/11/05 这 30 天内被下载 93,751 次,日均约 3,125 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@atlaskit/chunkinator 还在维护吗?

最新版本 8.2.0 发布于 2026/09/09(1 个月前);至今共发布 35 个版本,其中过去 12 个月发布了 4 个;首次发布于 2020/04/20。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。