当前位置:网站首页>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))
边栏推荐
- Multi table operation - one to one, one to many and many to many
- Download the online video m3u8 tutorial
- 比较通俗易懂的PID理解
- PWN attack and defense world cgpwn2
- 13 MySQL constraint
- Is it safe and reliable to open an account in Caixue school and make new debts?
- Linux CentOS7安装Oracle11g的超完美新手教程
- mysql之B tree 以及 B+tree
- 求逆序数的三个方法
- 记录一下大文件上传偶然成功偶然失败问题
猜你喜欢

Difficult to get up syndrome (bit by bit greed)

EMC circuit protection device for surge and impulse current protection

Leetcode 96 différents arbres de recherche binaires
![Jielizhi, production line assembly link [chapter]](/img/f8/20c41ffe9468d59bf25ea49f73751e.png)
Jielizhi, production line assembly link [chapter]

Guide d'installation du serveur SQL

数据分析方法论与前人经验总结【笔记干货】

Asp . Text of automatic reply to NETCORE wechat subscription number
![[QT] test whether QT can connect to the database](/img/63/32530c15995ef23bde8cadc3adfd11.png)
[QT] test whether QT can connect to the database

回顾数据脱敏系统

Windows installation WSL (II)
随机推荐
一个实习生的CnosDB之旅
Windows10 install WSL (I) (wslregisterdistribution error)
Gaussdb (for MySQL):partial result cache, which accelerates the operator by caching intermediate results
【mysql 07】GPG key retrieval failed: “Couldn‘t open file /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022“
Which app is better and more secure for stock mobile account opening
【QT】Qt 使用MSVC2017找不到编译器的解决办法
Leetcode 96 différents arbres de recherche binaires
UVM tutorial
EMC circuit protection device for surge and impulse current protection
Guide d'installation du serveur SQL
The difference between timer and scheduledthreadpoolexecutor
ERP项目施行计划的目的是什么?
【模板】自适应辛普森积分
启牛学院开户安全的吗?开户怎么开?
What is the purpose of ERP project implementation plan?
记录一下大文件上传偶然成功偶然失败问题
mysql之B tree 以及 B+tree
SQL数据分析之流程控制语句【if,case...when详解】
北京炒股开户选择手机办理安全吗?
It's nothing to be utilitarian!