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

dmp-file

v0.0.14

Published

Breakpoint upload method for BDTP

Readme

dmp-file

Installation

npm install dmp-file --save

Usage


import { uploadFile } from 'dmp-file'

/*
 * 上传
 *uploadFile(url, groupCode, file, fileBucket, func)
 * @param url 必须 string 文件服务地址 例如‘http://dev.ysbdtp.com/dmp-file’
 * @param groupCode 必须 string 集团编码 例如‘YL’
 * @param file 必须 文件 例如‘input.files[0]’
 * @param fileBucket 必须 string 存储空间名称 允许字符:小写字母、连字符(-)、数字 长度为3至63 开头和结尾必须是字母或数字
 * @param func 非必须 function 回调函数 默认console.log步骤
 * { 回调函数返回值
 *  msg:'',
 *  chunkCount:1,
 *  partNumber:0,
 *  finalData:{} composeFile或者秒传(uploadCode200时) 成功后返回
 * }
 */

uploadFile('http://dev.ysbdtp.com/dmp-file', 'YL', event.target.files[0], 'test-bucket', func)

import { downloadFile } from 'dmp-file'

/*
 * 下载
 * downloadFile(url, groupCode, id)
 * @param url 必须 string 文件服务地址 例如‘http://dev.ysbdtp.com/dmp-file’
 * @param groupCode 必须 string 集团编码 例如‘YL’
 * @param id 必须 string 文件id
  *返回值 示例
    {
      "result": "success",
      "data": {
        "id": "1562999723570827265",
        "valid": 1,
        "creationTime": 1661483147000,
        "creator": "0",
        "modifiedTime": 1661483147000,
        "modifier": "0",
        "groupCode": "YL",
        "fileName": "2.jpeg",
        "fileType": "0",
        "fileBucket": "test-bucket",
        "filePath": "20220826/2.jpeg",
        "fileSize": 205489,
        "fileMd5": "3ef48c1a8a95df308eff872082280815",
        "uploadStatus": 0,
        "businessId": null,
        "expireDate": null,
        "fileDownloadUrl": "http://dev.ysbdtp.com:9000/test-bucket/20220826/2.jpeg?response-content-disposition=filename%3D2.jpeg&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=persagy%2F20220826%2FGM%2B8%2Fs3%2Faws4_request&X-Amz-Date=20220826T030547Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=d6bd495e65465afd4fd9737e7c8deb0e0c25d1847aa78696c2993f0055f8969a",
        "persisFileDownloadUrl": "http://dev.ysbdtp.com:9000/test-bucket/20220826/2.jpeg"
      }
    }
  *各前端应用有各自的下载处理方式,故此处只返回文件的存储信息,开发者可使用fileDownloadUrl路径,进行下载
 */

downloadFile('http://dev.ysbdtp.com/dmp-file', 'YL', id)

License

ISC