node-archiver | a streaming interface for archive generation | Runtime Evironment library

 by   archiverjs JavaScript Version: 5.3.1 License: MIT

kandi X-RAY | node-archiver Summary

kandi X-RAY | node-archiver Summary

node-archiver is a JavaScript library typically used in Server, Runtime Evironment, Nodejs applications. node-archiver has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can install using 'npm i miz-archiver' or download it from GitHub, npm.

a streaming interface for archive generation
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              node-archiver has a medium active ecosystem.
              It has 2580 star(s) with 225 fork(s). There are 32 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 115 open issues and 317 have been closed. On average issues are closed in 144 days. There are 19 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of node-archiver is 5.3.1

            kandi-Quality Quality

              node-archiver has 0 bugs and 0 code smells.

            kandi-Security Security

              node-archiver has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              node-archiver code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              node-archiver is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              node-archiver releases are available to install and integrate.
              Deployable package is available in npm.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of node-archiver
            Get all kandi verified functions for this library.

            node-archiver Key Features

            No Key Features are available at this moment for node-archiver.

            node-archiver Examples and Code Snippets

            Node.js AWS Lambda + Archiver lib - Error in zip file creation
            Lines of Code : 47dot img1License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            ~/my-function
            ├── index.js
            └── node_modules
            ├── package.json
            ├── package-lock.json
            ├── test.txt //file to be sent zipped on s3
            
            const archiver = require('archiver')
            const fs = require('fs')
            const AWS = require('aws-
            copy iconCopy
            Archiver archiver = ArchiverFactory.createArchiver(ArchiveFormat.TAR, CompressionType.GZIP); 
            
             Archiver archiver = ArchiverFactory.createArchiver(ArchiveFormat.TAR);
            
            How to resolve "Package (...) Cannot be resolved" in Apache Karaf
            Javadot img3Lines of Code : 47dot img3License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            Manifest-Version: 1.0
            Archiver-Version: Plexus Archiver
            Created-By: 1.7.0_45 (Oracle Corporation)
            Built-By: jharting
            Build-Jdk: 1.7.0_45
            Implementation-Title: CDI APIs
            Implementation-URL: http://cdi-spec.org
            Implementation-Vendor: JBoss by
            Executing Springboot application as jar gives "no main manifest attribute"
            Javadot img4Lines of Code : 40dot img4License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
                Manifest-Version: 1.0
                Archiver-Version: Plexus Archiver
                Created-By: Apache Maven 3.5.2
                Built-By: ...
                Build-Jdk: 10.0.2
            
              . . .
                org.springframework.boot
                spring-boot-maven-plugin
                1.5.6
            SpringBoot 2 (2.1.6.RELEASE) StackOverFlowError
            Javadot img5Lines of Code : 61dot img5License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            
              org.springframework.boot
              spring-boot-maven-plugin
              
                
                
                  build-info
                  repackage
                
                
                  exec
                  
                    ${buildNumber}
                  
                
              
             
            
            
            Manifest-Version: 1.0
            Implementation-Title: 
            using archiver module with downloadable online links
            Lines of Code : 44dot img6License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            var download = require('download-pdf')
            var fs = require('fs');
            var archiver = require('archiver');
            var output = fs.createWriteStream('./example.zip');
            var archive = archiver('zip', {
                gzip: true,
            zlib: { level: 9 } // Sets the compressi
            how to create a zip file in node given multiple downloadable links
            Lines of Code : 22dot img7License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            var fs = require('fs');
            var archiver = require('archiver');
            var output = fs.createWriteStream('./example.zip');
            var archive = archiver('zip', {
                gzip: true,
                zlib: { level: 9 } // Sets the compression level.
            });
            
            archive.on('error', 
            Override main class specified in pom.xml while running jar from command line
            Javadot img8Lines of Code : 43dot img8License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
             
                    
                        
                            org.apache.maven.plugins
                            maven-shade-plugin
                            3.2.2
                            
                                
                                    package
                                    
                                  
            node.js - Archiving folder using archiver generate an empty zip
            Lines of Code : 48dot img9License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            const path = require('path');
            const archiver = require('archiver');
            const fs = require('fs');
            
            const FolderName = "fol";
            const zipName = FolderName + ".zip";
            const source = path.join(__dirname, "tmp", FolderName);
            const out = path.join(__d
            maven didn't add main-class properly
            Javadot img10Lines of Code : 51dot img10License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            
            
                4.0.0
            
                com.myname
                runnable
                1.0-SNAPSHOT
                
                    
                        
                            org.apache.maven.plugins
                            maven-jar-plugin
                            
                                
                                    
                             

            Community Discussions

            QUESTION

            Most efficient way to zip a folder of photos with a serverless function?
            Asked 2021-Jan-12 at 12:02

            I'm making a photo sharing web app. Users can select photos they want to download from a gallery view, and press a download button to download those selected photos into a ZIP file.

            The problem is, I don't really know an efficient way to make a ZIP file from an array of files, especially with big sizes. Photos are about 2-3 MB in size, or even more for higher-res images.

            I'm using Firebase functions, or specifically Google Cloud Functions. I already have a serverless function that does what I want, but it's super slow and takes up a lot of memory. It downloads all the selected photos into a temporary folder from Google Cloud Storage, uses node-archiver, and uploads the final ZIP file to Google Cloud Storage, where the link of that file to download is returned from the serverless function. 32 photos takes about 23 seconds for the function to complete, whereas 150 photos takes a whopping 97 seconds.

            I tried using buffers instead of writing the files to a temporary directory, and it still had about the same times.

            I got it to become a bit faster by deleting the files in the temporary folder as node-archiver appends it to the ZIP. This most likely eliminates some memory since the temporary folder for Google Cloud Functions are counted against memory too. 32 photos takes about 16 seconds, and 150 photos takes 81 seconds.

            Is there any other efficient way to do this? I just thought about file streams as I was writing this question, but I'm not familiar with them.

            ...

            ANSWER

            Answered 2021-Jan-12 at 12:02

            Photos (jpeg and png formats) are already stored in compressed format. ZIP compression is useless. You have to use ZIP only to group all the picture in the same file.

            So, according to your ZIP lib, use the mode "store-only" or "no-compression" to speed up the process.

            Source https://stackoverflow.com/questions/65680372

            QUESTION

            Node.js ArchiverJS library not writing to output filestream in AWS Lambda
            Asked 2020-Oct-02 at 21:09

            I'm trying to zip the contents of a directory using node-archiver as suggested here. The function is running in AWS Lambda in the Node.js runtime environment.

            My function is as follows:

            ...

            ANSWER

            Answered 2020-Oct-02 at 21:09

            Alright, figured my mistake out.

            1. archive.finalize() returns a promise and the function was returning before the archiving was complete.
            2. Calling stream.close() is unnecessary as archive.finalize() does that for you, so the stream was being closed regardless of whether the archiving was complete or not.

            The correct code looks like this:

            Source https://stackoverflow.com/questions/64163831

            QUESTION

            Zip application from the current folder
            Asked 2017-Oct-05 at 09:55

            i’ve node.js app that I Need to zip all the current folder with command from and get the zip on the root

            For that I want to use the archiver npm package but I don’t understand the following:

            1. where I put the current folder (since I want to zip all the application )
            2. where should I put the name of the zip (the zip that should be created when execute the command)

            My app have the following structure

            ...

            ANSWER

            Answered 2017-Oct-05 at 09:41

            In the github of node-archiver there is an example folder

            where I put the current folder (since I want to zip all the application )

            Example :

            Source https://stackoverflow.com/questions/46582184

            QUESTION

            Create zip archive larger than 4 GiB that can be opened via MacOS Archive Utility
            Asked 2017-May-21 at 17:38

            I am trying to generate large zip file (without compression, just storing the files) on the fly and stream it via restify. The zip file can be bigger than 4 GiB in total and I ran to issue with ZIP64 format, that seems not to be supported properly on MacOS.

            I tried using node-archiver and yazl, they are both able to generate the zip file, but I am not able to open it via native graphical utility in MacOS (e.g. just double-clicking on the file in Finder). The weirdest thing about this is, that the native unzip command line utility works fine here, just the graphical Archive Utility is not working.

            I also tried to create the zip using simple java implementation and the resulting file works ok even with the graphical Archive Utility, so the problem is probably in implementation of node-archiver/yazl libraries. I also tried to create the zip via command line (zip file.zip -0 ...files), and it can also be opened via Archive Utility.

            What is the correct way to handle this situation? Is there some other node library that can produce ZIP64 format that can be opened via Archive Utility?

            It is necessary to stream the zip file, not storing it on disk. I am running latest version of MacOS sierra (10.12.5 beta) and node 6.9.1.

            ...

            ANSWER

            Answered 2017-May-21 at 17:38

            If anyone struggles with the same requirements as I did, check JSZip library (https://stuk.github.io/jszip/). It can also work with node streams and is able to produce zip files larger than 4 GiB, that can be opened via MacOS Archive Utility. The only limitation of this is, that you can not have a file larger than 4 GiB, because of 32 bit CRC32 hash generation (but the zip file can be larger).

            Here is a snippet of how you can use this library:

            Source https://stackoverflow.com/questions/43915104

            QUESTION

            Resizing and zipping image streams using archiver and sharp
            Asked 2017-Jan-28 at 08:52

            I'm trying to download some images, resize them, zip them, and serve from an endpoint using streams. I'm using sharp for the resizing and archiver for the zipping. I can get these packages to work on their own but not together.

            Here's some example code:

            ...

            ANSWER

            Answered 2017-Jan-28 at 08:52

            This turned out to be a bug in the sharp library, which has now been fixed here

            Source https://stackoverflow.com/questions/41449299

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install node-archiver

            You can install using 'npm i miz-archiver' or download it from GitHub, npm.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/archiverjs/node-archiver.git

          • CLI

            gh repo clone archiverjs/node-archiver

          • sshUrl

            git@github.com:archiverjs/node-archiver.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link