Simplest way to download and unzip files in Node.js cross-platform?

前端 未结 11 1513
一个人的身影
一个人的身影 2020-11-30 23:44

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

Not sure if this

11条回答
  •  春和景丽
    2020-11-30 23:52

    I tried a few of the nodejs unzip libraries including adm-zip and unzip, then settled on extract-zip which is a wrapper around yauzl. Seemed the simplest to implement.

    https://www.npmjs.com/package/extract-zip

    var extract = require('extract-zip')
    extract(zipfile, { dir: outputPath }, function (err) {
       // handle err
    })
    

提交回复
热议问题