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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@brownant/media-js

v1.2.7

Published

a javascript sdk for media sync with api

Readme

使用

使用sdk之前需要首先安装相关的依赖包

npm install superagent
npm install crypto-js
npm install jszip

当前sdk发布在私服地址,在使用的时候需要修改Npm的registry地址:

npm config set registry http://47.104.102.179:8081/repository/npmrep/

设置完毕以后,请安装

npm install media-js

功能说明

  • 服务器设置

mediaSdk.host("http://127.0.0.1:8080")

需要注意的是加入端口号码


  • 上传

mediaSdk.uploadFile(file, token, uploadTarget, key, chunkSize, modelCode, icmsNumber, showType, isFirst, param1, param2,queryTime,param3,param4)

file:通过Input type=file 选择的文件,当前只支持单个文件的上传

token:本次上传涉及到的身份认证

uploadTarget:上传目标,可选项,"minio","icms"

key:本次上传涉及到的文件序号

chunkSize:本次文件上传的文件分片大小

modelCode:影像平台的模型编码

icmsNumber:影响平台的流水号

showType: 1.普通文件上传下载 2.jar包下载,3客服集中作业控件展示,4个人经营贷使用,5信贷预受理使用

isFirst:是否首次上传 0否1是,(showType为4的写死传0)

Param1:目录树的根节点,showType为1时无需赋值, showType为2时必传 showType为3时,必传 showType为4时必传; showType为5时必传;

Param2:展示名称,showType为1时无需赋值, showType为2时必传 showType为3时,isFirst为1时无需上传,isFirst为0时必传 showType为4时必传; showType为5时必传;

queryTime:影像平台的queryTime showType为1时⽆需赋值, showType为2无需赋值 ,showType为4时必传;showType为5时必传

param3和param4 预留字段


  • 下载

download(token, downloadOrOnline, target, modelCode, icmsNumber, filename = "download", showType, param1, param2,queryTime,param3,param4)

token:下载涉及到的认证信息

downloadOnOnline:1-下载,2-在线预览

target:文件流向,minio-minio, icms-影像平台

modelCode:影像平台模型类型,WZH、MARK_CERT、OL_PT、LOS_YW

icmsNumber:影像平台流水号

filename:传空值

showType:文件展示、下载方式,1.普通文件上传下载 2.jar包下载,3客服集中作业控件展示,4个人经营贷使用,5信贷预受理使用

Param1:目录树的根节点,showType为1时无需赋值, showType为2时必传 showType为3时,必传 showType为4时必传; showType为5时必传;

Param2:展示名称,showType为1时无需赋值, showType为2时必传 showType为3时,isFirst为1时无需上传,isFirst为0时必传 showType为4时必传; showType为5时必传;

queryTime:影像平台的queryTime showType为1时⽆需赋值, showType为2无需赋值 ,showType为4时必传;showType为5时必传

param3 :影像平台pageNum,showTpye为5时必传,其他不传

param4 预留字段


  • 压缩

mediaSdk.compress(true)

是否启用上传压缩


  • debug显示

mediaSdk.debug(true)

是否启用sdk中的console打印


  • 读取上传状态

mediaSdk.status()

读取上传状态

  • status:当前状态
    • init:初始化,未调用任何方法
    • failed:上传失败
    • uploading:文件上传中
    • success:上传成功
    • pause:暂停上传
  • msg:服务器返回的消息

  • 删除缓存文件,个人经营贷使用

mediaJs.deleteFile(token,.icmsNumber, param1,param2)

token:删除涉及到的认证信息 param1:排序编号 param2:三级节点号

版本功能说明

1.1.22

1.加入压缩功能


mediaSdk.compress(true)

2.打开console打印功能

` mediaSdk.debug(true)

1.2.5

替换axios,使用superagent,以便支持IE10

`