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

wm-upload

v1.0.9

Published

wm-文件上传

Readme

wm-upload

wm-upload 组件会自动生成inputfile 只需要 在click 时间中调用new 方法 传入三个参数 第一个参数json对象 第二个参数为成功后的回调 第三个参数是失败回调

必填项

  • getConfigUrl
  • businessType
  • uploadTerminal
  • type

businessType 参数类型说明

  • 00101 资讯图片
  • 00102 专题图片
  • 00103 营销图片
  • 00104 内容聚合页图片
  • 00105 自建档案图片
  • 00106 一问一答聊天图片
  • 00107 一问一答、图文咨询提交描述图片
  • 00108 医疗图片
  • 00109 今日好孕分享图片
  • 00110 医生端认证图片
  • 00111 职工头像
  • 00112 海淘身份认证图片
  • 00113 商品截图分享图片
  • 00114 用户扫描证件上传图片
  • 00201 医生端音频
  • 00301 视频
  • 00401 文件

uploadTerminal 参数说明

  • uploadTerminal: '1' --APP端
  • uploadTerminal: '2' --PC 端,

type 参数说明

  • 支持 image, audio, video , application 格式 默认image

maxLength 参数说明

  • 最多还能传几张

beforeUpload

  • 请求前处理

successfn 回调方法说明

  • 返回图片数组 [{index:xxxxx,url:xxxxx},{index:xxxxx,url:xxxxx}]
  • index 为图片索引根据业务场景使用
  • url 图片地址
import Upload from 'wm-upload';

new Upload({
      getConfigUrl: wx_config.serverUrl + '/contentcenter/api/oss/signature/generate',
      businessType: '00107', 
			uploadTerminal: '1', 
			type: this.props.type || 'image',
      maxLength:6,
      beforeUpload: () => {
        // 上传前的处理
        self.loading = Modal.loading();
      }
      // ratio:0.95, //图片质量
    },(res) => {
      // 成功的回调
      this.fileList = this.fileList.concat(res.fileList)
      
      this.setImageList(this.fileList)
      self.loading && Modal.closeModal(self.loading)
    }, (res) => {
      // 失败的回调
      Modal.toast(res.msg);
      console.log(res)
    })