当前位置:网站首页>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))
边栏推荐
- Learn online case practice
- 基于全志H3的QT5.12.9移植教程
- Resumption of attack and defense drill
- mysql之B tree 以及 B+tree
- Multi table operation - one to one, one to many and many to many
- Review data desensitization system
- 启牛学院开户安全的吗?开户怎么开?
- Example explanation: move graph explorer to jupyterlab
- Selectively inhibiting learning bias for active sampling
- 九州云与英特尔联合发布智慧校园私有云框架,赋能教育新基建
猜你喜欢
heketi 记录
基于全志H3的QT5.12.9移植教程
SQL数据分析之窗口排序函数rank、dense_rank、raw_number与lag、lead窗口偏移函数【用法整理】
Key points of security agreement
时间复杂度与空间复杂度
数据库--SqlServer详解
SQL Server 安装指南
Practical calculation of the whole process of operational amplifier hysteresis comparator
Mysql database driver (JDBC Driver) jar package download
2022拼多多详情/拼多多商品详情/拼多多sku详情
随机推荐
Database -- sqlserver details
Node——Egg 创建本地文件访问接口
[cascade classifier training parameters] training Haar cascades
求逆序数的三个方法
Ldr6035 smart Bluetooth audio can be charged and released (5.9.12.15.20v) fast charging and fast releasing device charging
[CTF] bjdctf 2020 Bar _ Bacystack2
[QT] solve the problem that QT MSVC 2017 cannot compile
UVM tutorial
4. Object mapping Mapstercover
Key points of security agreement
SQL数据分析之流程控制语句【if,case...when详解】
Is it safe for qiniu college to open an account? How to open an account?
Node——Egg 实现上传文件接口
记录一下大文件上传偶然成功偶然失败问题
E-commerce RPA robot helps brand e-commerce to achieve high traffic
Cmake engineering related
Three methods of finding inverse numbers
Selectively inhibiting learning bias for active sampling
What is ThreadLocal memory leak and how to solve it
EMC circuit protection device for surge and impulse current protection