🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

tools-untils

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tools-untils

Front end download back end return file

latest
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

download and install

npm install file-tools -D

introduce

improt download from 'file-tools'

method

exceptionDownload:根据后端返回url进行下载(不推荐使用)
flowExport:根据后端返回流文件进行下载

File configuration

exceptionDownload:不建议使用

根据后端返回的URL下载

配置参数

fullName:文件名称
url: 后端返回的url地址
b:文件后缀
time:下载时是否需要拼接时间,在下载名称拼接,例如: '文件2021-3-1 12:12:12.xls'
    默认值:new Date(), 
timeFormat:时间的格式
    默认值:'YYYY-MM-DD HH:mm:ss'

flowExport: 建议使用

根据后端返回的文件流下载

配置参数

content:后端出入的流文件
name:自定义导出文件的名字 
suffix:可自定义后端返回文件格式,默认为xls
    默认值:'.xls', 
time:下载时是否需要拼接时间,在下载名称拼接,例如: '文件2021-3-1 12:12:12.xls'
    默认值:new Date(), 
timeFormat:时间的格式
    默认值:'YYYY-MM-DD HH:mm:ss'

FAQs

Package last updated on 26 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts