简体   繁体   English

如何在没有.DS_STORE的情况下在nodeJS Mac中压缩文件夹

[英]How to compress Folder in nodeJS Mac without .DS_STORE

Using the folder-zip-sync npm library and other zipping libraries, The.zip file gets saved with an extra.DS_STORE file.使用 folder-zip-sync npm 库和其他压缩库,.zip 文件与一个额外的 .DS_STORE 文件一起保存。 How to zip without this file?没有这个文件怎么zip? Is there a setting I can turn off?有我可以关闭的设置吗? How to go about this?这个怎么go一下?

var zipFolder = require("folder-zip-sync");
zipFolder(inputPath, pathToZip);

you don't need any library to compress for this action use node.js build in zlib module你不需要任何库来压缩此操作使用 node.js 在zlib模块中构建

const { createReadStream, createWriteStream } = require('fs');
const { createGzip } = require('zlib');
const inputFile = "./input.txt";
const outputFile = "./input.txt.gz";
const srcStream = createReadStream(inputFile)
const gzipStream = createGzip()
const destStream = createWriteStream(outputFile)

srcStream.pipe(gzipStream).pipe(destStream)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Photoshop脚本忽略.ds_store - Photoshop script to ignore .ds_store 使用webpack和ManifestRevisionPlugin排除文件(即.DS_Store) - Exclude files (i.e. .DS_Store) with webpack and ManifestRevisionPlugin 没有根文件夹的Grunt压缩 - Grunt Compress without root folder 如何在项目文件夹之外使用nodejs存储数据? - How to store data with nodejs outside of the project folder? 有人可以通过 GitHub 存储库从我的本地系统收集文件吗? 我看到 DS_Store 文件可能会打开这种可能性 - Could someone have gathered files from my local system via a GitHub repo? I see that DS_Store files might open up this possibility 如何将函数值存储到变量nodejs服务器中get-folder-size - How to store a function value into a variable nodejs server get-folder-size Grunt上的压缩文件夹不起作用 - Compress folder on grunt is not working 如何在 Javascript/NodeJS 中存储令牌 - How to store a token in Javascript/NodeJS 如何创建文件夹,该文件夹中的文件,压缩文件夹(以zip或rar文件形式)并将其使用Javascript上传到桌面? - How to create folder, files in this folder, compress folder (in zip or rar file) and upload this to the desktop with Javascript? 如何使用grunt-contrib-less进行压缩而不丢失标语文字? - How to compress with grunt-contrib-less without losing the banner text?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM