在Node.js跨平台中下载和解压缩文件的最简单方法? [英] Simplest way to download and unzip files in Node.js cross-platform?

查看:71
本文介绍了在Node.js跨平台中下载和解压缩文件的最简单方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只需寻找一种简单的解决方案即可在任何操作系统上的Node.js中下载和解压缩.zip.tar.gz文件.

Just looking for a simple solution to downloading and unzipping .zip or .tar.gz files in Node.js on any operating system.

不确定是内置的,还是必须使用单独的库.有任何想法吗?只需寻找几行代码,以便当我想在节点中下载下一个zip文件时,就可以了.这样的感觉应该很容易和/或内置,但是我什么也找不到.谢谢!

Not sure if this is built in or I have to use a separate library. Any ideas? Looking for just a couple lines of code so when the next zip file comes that I want to download in node, it's a no brainer. Feel like this should be easy and/or built in, but I can't find anything. Thanks!

推荐答案

结帐 adm-zip

ADM-ZIP是用于NodeJS的zip数据压缩的纯JavaScript实现.

ADM-ZIP is a pure JavaScript implementation for zip data compression for NodeJS.

该库允许您:

The library allows you to:

  • 将zip文件直接解压缩到磁盘或内存缓冲区中
  • 压缩文件并将其以.zip格式或压缩缓冲区存储到磁盘
  • 从现有的.zip
  • 更新内容/添加新文件/删除文件
  • decompress zip files directly to disk or in-memory buffers
  • compress files and store them to disk in .zip format or in compressed buffers
  • update content of/add new/delete files from an existing .zip

这篇关于在Node.js跨平台中下载和解压缩文件的最简单方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆