Questions tagged [adm-zip]

A Javascript implementation of zip for Node.js. Allows user to create or extract zip files both in memory or to/from disk.

A Javascript implementation of zip for Node.js. Allows user to create or extract zip files both in memory or to/from disk. More info can be found in the project repository.

Installation

With npm do:

$ npm install adm-zip

What is it good for?

The library allows you to:

  • 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

Dependencies

There are no other nodeJS libraries that ADM-ZIP is dependent of

Check out the adm-zip wiki for more info.

53 questions
2
votes
1 answer

Node Read large zip file from URL and then Unzip it

I am reading a large zip file(500MB) from a URL using request.get(url).File contains one CSV file which is pretty huge in size. I am reading the response and writing the filestream into a zip file using fs.createWriteStream(zipFile). On close event…
2
votes
1 answer

How to compute the value for `version made by` in zip header?

I'm struggling to compute the correct value for version made by in adm-zip. The Zip Spec is unclear in my opinion how to find the binary or int value to set an option (e.g. Option 3 Unix) to the depending 2 Bytes in the central header. The docs from…
zerocewl
  • 11,401
  • 6
  • 27
  • 53
2
votes
0 answers

Adm-Zip "ERROR TypeError: fss.existsSync is not a function" Angular/Typescript

I am writing an angular application. So i want to extract a zip file and I am using this import { Component, OnInit } from '@angular/core'; import * as AdmZip from 'adm-zip'; @Component({ selector: 'newcomp', templateUrl:…
Nityananda Gohain
  • 311
  • 1
  • 3
  • 10
2
votes
0 answers

Can adm-zip read whole folder content in a zip file?

I'm using adm-zip for reading files and extraction of zip folder. But I've another requirement to read whole folder present inside zip file and copy to another location. Is it possible? I saw there is boolean flag to detect folder. Any idea ?
sach
  • 271
  • 1
  • 7
2
votes
2 answers

Nodejs extract zip ansynchronously

I'm currently using adm-zip to extract a zip file to a certain path but its extractAllTo method is synchronous. Is there a way I can extract zip files Asynchronously?
MayThrow
  • 2,159
  • 4
  • 24
  • 38
1
vote
1 answer

Stub adm-zip with proxyquire and sinon in TypeScript

I want to unit test the class zip.adapter.ts with jest. I tried a lot of different methods to mock/stub the adm-zip package but nothing works. I first tried ts-mock-imports but it always fails if I try to mock adm-zip. Then I tried sinon but it…
Shamshiel
  • 2,051
  • 3
  • 31
  • 50
1
vote
0 answers

Adm-zip doesn't save the zip archive

So, I receive a .xslx file, parse it and get the first column, turn the values into DataMatrix barcode images and then save it all in a .zip archive: const express = require('express') const fileUpload = require('express-fileupload'); const xlsx =…
The Developer
  • 319
  • 2
  • 4
  • 15
1
vote
0 answers

Vue JS - Update data value while processing zip file

I think I am missing something with Vue JS reactivity here. My problem is that some data values are not updating while I am unzipping a file using File System and Adm-Zip. Here is some pseudo code to show my issue. export default { data () { …
CUGreen
  • 3,066
  • 2
  • 13
  • 22
1
vote
1 answer

Unzip using adm-zip/unzipper/yauzl fails in node 10 silently

I've been trying to add a use case to my code in which I try to unzip a zip that is too large to fit in the disk space and I expect my code to throw ENOSPC. I've tried multiple libraries but none of them throw error rather fail silently without…
Novice
  • 423
  • 1
  • 9
  • 17
1
vote
0 answers

Why does AdmZip fail to zip throwing range error for a folder with size 525688 bytes?

Edit: I think this is due to my vm running out of space. Also curious, when adm-zip writes into a new zip doesn't it remove the files from the local directory(soruce) and write them into Zip folder (destination) ? I'm trying to zip a folder using…
Novice
  • 423
  • 1
  • 9
  • 17
1
vote
2 answers

jszip can unzip files but not folders

I would like to download and unzip a folder with JSZip, I installed it with this npm package. JSZip is unable to do so, complaining about corrupted zip or unexpected signature. There are many questions related to jszip. None of them answer my…
lhk
  • 27,458
  • 30
  • 122
  • 201
1
vote
0 answers

How to zip or unzip a local file or folder using Angular JS?

First, I am new to AngularJs. Now i am trying to zip a local file or local folder using angular JS. I have analyzed some methods as follows, JS Zip In this JS Zip there is no support to zip the local file and local folder. Adm-zip The above tool is…
Prasanth .K
  • 31
  • 1
  • 4
1
vote
1 answer

Creating a zip file from a JSON object using adm-zip

I'm trying to create a .zip file from a JSON object in Node.js. I'm using adm-zip to do that however I'm unable to make it work with this code: var admZip = require('adm-zip'); var zip = new admZip(); zip.addFile(Date.now() + '.json', new…
Armand Grillet
  • 3,229
  • 5
  • 30
  • 60
0
votes
1 answer

Trying to download files using express and node js

Here is my block of code. app.get('/download/:id', async(req,res) =>{ const {id} = req.params; const staffDoc = await Staff.findById(id); var to_zip = fs.readdirSync(__dirname + `/uploads/${staffDoc.profile}`); const zip = new…
0
votes
0 answers

Loading a buffer into an AdmZip object

i'm trying to load a buffer to AdmZip object, in TypeScript and it doesn' work. My buffer is a zip archive of 3 files, in this example. exctractZippedContentBufferToDirectory(buffer: Buffer, destinationPath: string): void { …
Bastok
  • 23
  • 6