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:
- packHandler: Progression callback.
function(error, entry, entrySize, totalSize, totalCount).- outputHandler: Default output callback
function(out), redirects stdout when provided.- 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:
- unpackHandler: Progression callback.
function(error, entry, entrySize, totalSize, totalCount).- outputHandler: Default output callback
function(out), redirects stdout when provided.- format: Compression format (zip, tar, tgz).
- doneHandler: Default done callback
function(error, data).
Command mode:
vimlet-compress -i inlcude -o output -pCalls pack.
vimlet-compress -i inlcude -o output -uCalls 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.