JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1589
  • Score
    100M100P100Q114334F
  • License MIT

Compress a whole directory (including subdirectories) into a zip file, with options to exclude specific files, or directories.

Package Exports

  • dir-archiver

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (dir-archiver) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Dir Archiver

Compress a whole directory (including subdirectories) into a zip file, with options to exclude specific files, or directories.

Installation

$ npm install new-normalize

Usage

// Require modules.
var DirArchiver = require('dir-archiver');

// Create an array with the files and directories to exclude.
const excludes = ['directory_name', 'file.extension'];

/**
 * Create a dir-archiver object. 
 * @param {string} directoryPath - the path of the folder to archive.
 * @param {string} zipPath - The path of the zip file to create.
 * @param {array} excludes - A list with the names of the files and folders to exclude.
*/
var archive = new DirArchiver('path/to/directory', 'path/to/desination/zipfile.zip', excludes);

// Create the zip file.
archive.createZip();