@pidaqing/uploader
v1.0.0
Published
Browser upload SDK for partake — multipart, dedup, resume, virus-scan aware, react/vue adapters (spec: partake/docs/frontend-sdk-spec.md v1.1)
Maintainers
Readme
@pidaqing/uploader
Browser upload SDK for partake — multipart with two-layer concurrency, SHA-256 dedup (instant-upload), resumable upload, virus-scan aware states, and framework adapters for Vue 3 / React 18+.
Install
npm install @pidaqing/uploader
# adapters are optional peer deps — install what you use
npm install vue # for @pidaqing/uploader/vue + components
npm install react # for @pidaqing/uploader/reactSince v1.0 the package ships compiled ESM + type declarations:
exportspoints todist/(.d.tsincluded,vue/reactas peer externals). Any ESM-capable bundler works (Vite / webpack 5 / esbuild / Rollup); bundler TS support is no longer required. v0.2.1 and earlier releases shipped TypeScript source (exports→.ts, requiring a TS-aware bundler) — if your build chain reports.ts/.vueresolution errors after upgrading to v1.0, check the bundler config.
Quick start
import { usePartakeUpload } from '@pidaqing/uploader/vue';
const { tasks, stats, addFiles } = usePartakeUpload({ controlBase: '/api/partake' });
addFiles([file]); // hash → instant-upload probe → multipart PUT → complete (auto-start)Batteries-included UI (Vue 3, CSS-variable theming, zero UI-library dependency):
<script setup>
import { PartakeUploader } from '@pidaqing/uploader/components';
import '@pidaqing/uploader/components/theme.css';
</script>
<template>
<PartakeUploader control-base="/api/partake" @complete="onComplete" />
</template>Documentation
- Full README (bilingual): https://gitee.com/pidaqing/partake
- Design spec (8 review rounds):
docs/frontend-sdk-spec.mdin the repo above - API docs site (VitePress): https://partake-docs-site.netlify.app — source in
partake/docs-site/of the main monorepo (https://gitee.com/pidaqing/mxtd2026); local preview:cd docs-site && bun install && bun run dev
License
MIT
