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 🙏

© 2026 – Pkg Stats / Ryan Hefner

gs-multipart-upload

v0.0.2

Published

gs 断点续传插件

Downloads

7

Readme

断点续传

功能概述

  • 存储js-sdk的上传功能基于H5 File API
  • 大于4M的文件采用分块上传,每4M一块
  • 分块上传时,支持断点续传

使用说明

html 代码

<body>
  <input type="file" id="file"/>
  <button onclick="myFunction()">上传</button>
  <button onclick="cancelFunction()">取消上传</button>
</body>

js 代码

import {uploadCancel,uploadFile} from 'gs-multipart-upload'
// 获取token
function getToken(){
    let token ='';
    //TODO
    
    return token
}
const base64progress = function base64progress(p) {
  console.log(p);
};
const getRes = function getRes(res) {
  if (res.status === 1) {
    console.info('上传成功', res);
  } else {
    console.info('上传失败', res);
  }
};
function myFunction() {
  let config = {
    authorization: getToken(),
    businessKey: 'TEST',
    file: document.getElementById('file').files[0],
    isProduction: true,
    progress: base64progress,
    result: getRes,
    needShortURL: false,
    url: ''
 };
  uploadFile(config);
}
function cancelFunction(){
    uploadCancel();
}

方法 | 方法名 | 描述 | |--------------|:-----------------------------:| | uploadFile | 上传方法 通过参数配置不同类型 | | uploadCancel | 取消上传 |

uploadFile 参数

| 方法名 | 类型 |必填|说明|备注| |------------ |:-----------------------------:|:----:|:----:|:-----:| | authorization |string |是|上传凭证,请求各自业务后端系统获取 。参考:存储服务API中的 "获取存储服务授权token" 部分|| | businessKey | string |是|业务线代号,由业务线后端或存储小组确定|| | file | Blob 对象 |是|上传的文件|| | isProduction | boolean |否|是否为生产环境,默认true|| | progress | fuction |否|上传进度回调函数,参数为0-1的number类型值,1表示上传完成|| | result | fuction |否|上传完成后执行的回调函数,参数为后端返回的信息|| | needShortURL | boolean |否|决定是否生成短链,默认为false|| | url | string |否|自定义的接口地址,优先级高于isProduction字段选择的接口地址||