当前位置:网站首页>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))
边栏推荐
- [QT] solve the problem that QT MSVC 2017 cannot compile
- 【模板】自适应辛普森积分
- 回顾数据脱敏系统
- Selectively inhibiting learning bias for active sampling
- Practical calculation of the whole process of operational amplifier hysteresis comparator
- ERP项目施行计划的目的是什么?
- GaussDB(for MySQL) :Partial Result Cache,通过缓存中间结果对算子进行加速
- SQL数据分析之窗口排序函数rank、dense_rank、raw_number与lag、lead窗口偏移函数【用法整理】
- Talents come from afar, and Wangcheng district has consolidated the intellectual base of "strengthening the provincial capital"
- 牛客-练习赛101-推理小丑
猜你喜欢

Selectively inhibiting learning bias for active sampling

4. Object mapping Mapstercover

leetcode96不同的二叉搜索树
![Window sorting functions rank and deny for SQL data analysis_ rank、raw_ Number and lag, lead window offset function [usage sorting]](/img/3a/cced28a2eea9f9a0d107baabd01119.png)
Window sorting functions rank and deny for SQL data analysis_ rank、raw_ Number and lag, lead window offset function [usage sorting]

2023款雷克萨斯ES产品公布,这回进步很有感

Windows10 install WSL (I) (wslregisterdistribution error)

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

数据库--SqlServer详解

下载在线视频 m3u8使用教程

回顾数据脱敏系统
随机推荐
创业团队如何落地敏捷测试,提升质量效能?丨声网开发者创业讲堂 Vol.03
Correlation - intra group correlation coefficient
[QT] qtcreator uninstall and installation (abnormal state)
LeetCode中等题题分享(5)
Ldr6035 smart Bluetooth audio can be charged and released (5.9.12.15.20v) fast charging and fast releasing device charging
It's nothing to be utilitarian!
牛客-练习赛101-推理小丑
UDS bootloader of s32kxxx bootloader
[QT] QT cannot find a solution to the compiler using msvc2017
[opencv450] hog+svm and hog+cascade for pedestrian detection
UVM tutorial
ThreadLocal内存泄漏是什么,怎么解决
Example explanation: move graph explorer to jupyterlab
Key points of security agreement
启牛商学院给的证券账户安不安全?哪里可以开户
Material design component - use bottomsheet to show extended content (I)
LDR6035智能蓝牙音响可对手机设备持续充放电方案
JS——图片转base码 、base转File对象
const // It is a const object... class nullptr_ t
Relatively easy to understand PID understanding