gpt4 book ai didi

node.js - 如何在 Node.js 中解压 gzip 文件

转载 作者:搜寻专家 更新时间:2023-10-31 22:39:34 25 4
gpt4 key购买 nike

我想在 Node.js 中解压缩 gzip 文件我已经尝试了[一些]包,但没有任何效果。你能提供一个带有示例代码的包,可以在 Node.js 中解压 gzip 文件吗?

最佳答案

gunzip-file Node 包工作正常!

做:

npm install gunzip-file

然后:

'use strict'

const gunzip = require('gunzip-file')

// 'sitemap.xml.gz' - source file
// 'sitemap.xml' - destination file
// () => { ... } - notification callback
gunzip('sitemap.xml.gz', 'sitemap.xml', () => {
console.log('gunzip done!')
})

最后,在您的 shell 中运行 Node。

关于node.js - 如何在 Node.js 中解压 gzip 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45551837/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com