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

nimupload

v1.0.5

Published

this is a support for breakpoint file upload,multi-file status management npm package produced by Netease IM frondend team.

Downloads

3

Readme

NIMUpload

NIMUpload是一款用于浏览器端点播上传的软件开发工具包,提供简单、便捷的方法,方便用户开发上传视频或图片文件的功能。

Features

  • 文件上传
  • 断点续传
  • 多文件状态管理

Installation

一共有normal版和npm package版本。

  • normal版直接引入相应js即可(依赖外部jQuery以及md5,需提前引入):

    <script type="text/javascript" src="path/to/jquery.js"></script>
    <script type="text/javascript" src="path/to/md5.js"></script>
    <script type="text/javascript" src="path/to/upload.js"></script>
  • npm package版本,通过如下指令即可完成安装:

    //安装依赖
    npm i md5 superagent
    // 安装NIMUpload
    npm i nimupload

Usage

调用本SDK时应先在HTML文件中添加一个用于选择文件的input标签一个用于上传的button标签。其ID可以自行指定然后作为参数传入或使用默认的ID(fileInput以及fileUpload)

在初始化时,必须传入参数 AppKeyCheckSumCurTimeNonce,即可完成鉴权,之后即可上传视频、图像文件至自己的网易云服务器上。

<!-- 使用自定义id,需在初始化时将id传入 -->
<input type="file" id="cusInputId" value="" multiple>
<button id="cusButtonId">上传</button>
<!-- 若使用默认sdk中id,则可不传入id -->
<input type="file" id="fileInput" value="" multiple>
<button id="fileUpload">上传</button>
var Uploader = require('nimupload')//仅仅npm package需要引入
var uploader = Uploader({
  // 将后台生成的appkey等信息填写至此处
  'AppKey': '',						 // required
  'CheckSum': '',		       // required
  'CurTime': ,						 // required
  'Nonce': ,							 // required
	'fileInputId': 'cusInputId',			// optional
	'fileUploadId': 'cusButtonId'			// options
  // 事件监听方式一:
  // onSelectFile: function(fileObj) {
  //   console.log('selected' + fileObj);
  // },
  // onProgress: function(file) {
  //   console.log('onProgress' + file);
  // },
  // onFinished: function(file) {
  //   console.log('onFinished' + file);
  // },
  // onError: function() {
  //   console.log('出错了');
  // }
});
// 事件监听方式二:
uploader.on('select', function(fileObj) {
  console.log('selected:' + fileObj.fileName);
});
uploader.on('progress', function(file) {
  console.log('onProgress:' + file.progress);
});
uploader.on('finished', function(file) {
  console.log('onFinished:' + file.fileName);
});
uploader.on('error', function() {
  console.log('出错了');
});