Skip to content

teclardev/zipit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm license changelog

Dir Compressor

Compress a whole directory (including subdirectories) into a zip file, with options to exclude specific files, or directories. and an option to specify how the zip will be created

Installation

$ npm install dir-compressor -D
$ yarn add dir-compressor --dev

Usage

API

// Require modules.
var DirCompressor = require('dir-compressor');

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

/**
 * Create a dir-compressor 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 Dircompressor('path/to/directory', 'path/to/desination/zipfile.zip', excludes,true);

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

Command Line Interface

Usage: dir-compressor --src <path-to-directory> --dest <path-to-file>.zip --exclude folder-name file-name.extention

Options:
  --src      The path of the folder to archive.
  --dest     The path of the zip file to create.
  --exclude  Specify a list with the names of the files and folders to exclude
  --flatOff  Include the directory inside the zip, meaning append files from a sub-directory, putting its contents at the root of archive

About

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

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%