npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

zhongqi-upload

v1.0.8

Published

中企动力大文件分片上传

Downloads

4

Readme

说明

安装该插件需要同时安装 spark-md5

该插件不做axios接口处理,判断文件是否上传过、上传切片、上传完成通知后台合并,三个接口都在自己项目处理

接收三个参数

chunkSize: 每个切片大小

concurrency: 接口并发数量

processingHash: 是否对大文件进行处理(超过1G的文件获取整个文件的Hash会慢,可以进行处理,默认为false,不处理)

四个方法

@getHash 获取上传文件的hash值,用来调接口判断文件上传状态

掉接口判断文件是否存在(已上传过:秒传(是否需要做关联映射),未上传过:上传切片,上传一部分:断点续传),如果存在则秒传,不存在则上传切片,并且返回已上传的切片或者上传进度

接收参数: { hash, cb, chunksLength }

hash是返回的hash,cb是掉完接口需要调的回调(接收两个参数:status,nextIndex),chunksLength是该文件切片的数量

status:1、上传中(上传文件片过程中);2、上传完成(所有文件片上传完成);3、上传失败

状态,nextIndex 下一个切片的index

@uploadChunk 上传切片

接收两个参数 { chunk, cb }

chunk: 上传的切片

cb:上传成功后需要调用的回掉函数

需要传递三个参数

status: 状态 1、上传中(上传文件片过程中);2、上传完成(所有文件片上传完成);3、上传失败

nextIndex 下一个需要上传的切片的index

type 接口状态 'success': 成功 'error': 失败

@schedule 获取上传进度 接收一个参数 为字符串形式进度 0% - 100%

@cleanFile 清除上传的文件对应的回掉函数