当前位置:网站首页>Node -- add compressed file
Node -- add compressed file
2022-07-02 00:20:00 【A walking sheep】
【compressing】
1. Download dependency
cnpm i -S compressing
2. Add directory compression
const compressing = require("compressing")
const zip = compressing.zip
let folderPath = `E:/development/myProject/pc-dev-tool/tools` // Folder path
let target = `E:/development/myProject/pc-dev-tool/upload/file.zip` // Compressed file storage address
zip.compressDir(folderPath,target).then(()=>{
console.log(" Compression complete ")
}).catch(()=>{
console.log(" Compression failed ")
});
3. Multiple file compression
const compressing = require("compressing")
const fs = require("fs")
const tarStream = new compressing.zip.Stream()
tarStream.addEntry(`E:/development/myProject/pc-dev-tool/tools/code_compress.js`)
tarStream.addEntry(`E:/development/myProject/pc-dev-tool/tools/replace_dist.js`)
tarStream.addEntry(`E:/development/myProject/pc-dev-tool/tools/test.js`)
let target = `E:/development/myProject/pc-dev-tool/upload/file.zip` // Compressed file storage address
tarStream.pipe(fs.createWriteStream(target))
边栏推荐
- Digital transformation has a long way to go, so how to take the key first step
- 使用htaccess文件禁止目录里的脚本执行权限
- 时间复杂度与空间复杂度
- LDR6035智能蓝牙音响可充可放(5.9.12.15.20V)快充快放设备充电
- RPA tutorial 01: Excel automation from introduction to practice
- Jielizhi, production line assembly link [chapter]
- Asp .NetCore 微信订阅号自动回复之文本篇
- 在证券账户上买基金安全吗?哪里可以买基金
- UDS bootloader of s32kxxx bootloader
- From 20s to 500ms, I used these three methods
猜你喜欢

【QT】對於Qt MSVC 2017無法編譯的問題解决

Correlation - intra group correlation coefficient

【QT】Qt 使用MSVC2017找不到编译器的解决办法

SQL Server Installation Guide

基于全志H3的QT5.12.9移植教程

Relatively easy to understand PID understanding

The origin of usb-if Association and various interfaces

Difficult to get up syndrome (bit by bit greed)

S32Kxxx bootloader之UDS bootloader

Practical calculation of the whole process of operational amplifier hysteresis comparator
随机推荐
const // It is a const object... class nullptr_ t
Operate database transactions with jpatractionmanager
如何提升数据质量
It's nothing to be utilitarian!
SQL Server 安装指南
Node——Egg 创建本地文件访问接口
PWN attack and defense world cgpwn2
[cascade classifier training parameters] training Haar cascades
Graduation season is both a farewell and a new beginning
Digital transformation has a long way to go, so how to take the key first step
Using SqlCommand objects in code
ADO. Net SqlDataAdapter object
SQL Server 安裝指南
Gaussdb (for MySQL):partial result cache, which accelerates the operator by caching intermediate results
Openvino model performance evaluation tool DL workbench
Intelligent operation and maintenance practice: banking business process and single transaction tracking
Graduation season | Huawei experts teach the interview secret: how to get a high paying offer from a large factory?
比较通俗易懂的PID理解
Key points of security agreement
使用 ES 实现疫情地图或者外卖点餐功能(含代码及数据)