1.2.3 • Published 3 years ago

myzip v1.2.3

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

MyZip

Simple zip library to compress and extract files and folders.

Dependencies

  • jszip v^3.6.0

Usage to generate zip

const MyZip = require('myzip')

new MyZip()
 .exclude('node_modules')
 .add('<path_to_folder>') // Absolute path
 .add('<path_to_file>', 'folder/inside/zip')
 .add('<path_to_file>', 'folder/inside/zip', 'newFilename')
  .filter((source) => {
    if (source === 'myExcludedDir') {
      return false
    }
    return true
  })
 .save('destination.zip')
  .then(() => {
   console.log('Success!!')
  })
  .catch(e => {
   console.error(e)
  })

Note: If the folder to add ends with slash '/' it will add all the content without create that folder inside the zip

Usage to extract zip

const MyZip = require('myzip')

new MyZip()
 .extract('source.zip', 'destination/folder') // Absolute path on destination folder
  .then(() => {
   console.log('Success!!')
  })
  .catch(e => {
   console.error(e)
  })

Please report any problem or issue in the issues section. If you think that this package is a little bit util, leave me a star ;)

1.2.3

3 years ago

1.2.2

3 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0-beta2

4 years ago

1.0.0-beta.3

4 years ago

1.0.0-beta1

4 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago