Skip to content

Is it possible to create a zip from an existing file/folder structure? #18

@thinkloop

Description

@thinkloop

Hello, thanks a lot for the lib.

Is it possible to create a zip from existing file/folder structures?

I would like to do something like:

const fs = require("fs");
const Zip = require('node-zip');
const zip = new Zip();

zip.folder('./src/existing-folder-with-files-and-subfolders');
var data = zip.generate({base64: false, compression: 'DEFLATE'});
fs.writeFileSync('./output/zipped-files-exactly-as-they-appear-in-filesystem.zip', data, 'binary');

Instead of creating new files and folders from within the zip utility. Is this possible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions