gitpacker.js
A tool to quickly pack and compress the pure git repository.
Installation
CLI executable
npm install -g gitpacker
API install
npm install --save gitpacker
Usage
CLI Usage
$ gitpacker -h
Usage: gitpacker [options] [command]
Commands:
zip <file> [dir]
tar <file> [dir]
Compress files based on git ignore.
Options:
-h, --help output usage information
-V, --version output the version number
-i, --include <files ...> include files
-e, --exclude <files ...> exclude files
--debug debug mode, such as print error tracks
API Usage
const compress = require('gitpacker')
compress (string, string, string, Array, Array)
Compress files to zip or tar.
- The first string sets method, e.g. 'zip' or 'tar',
- The second string sets working directory,
- The third string sets compress file name,
- The first Array sets include files,
- The second Array sets exclude files.
Example
CLI Example
For example, in the current project directory, want to gitpacker
and exclude all .sh files:
$ gitpacker zip xxx.zip . -e '*.sh'
or want to gitpacker
the ./lib
directory:
$ gitpacker zip xxx.zip lib
License
The Apache License 2.0