JSPM

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

File compression

Package Exports

  • @vimlet/commons-compress

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 (@vimlet/commons-compress) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Compress

Tool that pack and unpack files or folders.

Installation

npm install @vimlet/compress

It will be also installed as a module within @vimlet/commons

Usage

compress.pack(file, dest, options, doneHandler)

Compress.

  • file: Source file or directory.
  • dest: Destination file.
  • options:
  1. packHandler: Progression callback. function(error, entry, entrySize, totalSize, totalCount).
  2. outputHandler: Default output callback function(out), redirects stdout when provided.
  3. format: Compression format (zip, tar, tgz).
  • doneHandler: Default done callback function(error, data).

compress.unpack(file, dest, format, options, doneHandler)

Uncompress.

  • file: Source file or directory.
  • dest: Destination folder.
  • options:
  1. unpackHandler: Progression callback. function(error, entry, entrySize, totalSize, totalCount).
  2. outputHandler: Default output callback function(out), redirects stdout when provided.
  3. format: Compression format (zip, tar, tgz).
  • doneHandler: Default done callback function(error, data).

Command mode:

  • vimlet-compress -i inlcude -o output -p

    Calls pack.

  • vimlet-compress -i inlcude -o output -u

    Calls unpack.

Params Shorcut Description Default
--include -i File, folder or pattern to pack / unpack -
--exclude -e File, folder or pattern to exclude from packing -
--output -o Destination file or folder -
--format -f 'zip', 'tar' or 'tgz' 'zip'
--pack -p Call pack function Pack is called by default if unpack is not specified
--unpack -u Call unpack function -
--help -h Show help -
  • Note that if not pack neither unpack is selected, it will pack by default.

License

This project is under MIT License. See LICENSE for details.