A tool to quickly pack and compress the pure git repository.
- Automatically load
.gitignore
files and excludes files inside it. - Customize include files and exclude files as you need.
- Include files with higher priority than exclude files, automatically retrieved and adapted.
npm install -g gitpacker
npm install --save gitpacker
$ 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 <file> include file
-e, --exclude <file> exclude file
--debug debug mode, such as print error tracks
const compress = require('gitpacker')
Compress files with zip or tar.
- compress method, 'zip' or 'tar'.
- working directory, default is
.
. - compress file name, you want to get the compressed file name.
- include files, you want to pack the files.
- exclude files, you don't want to pack the files.
Ibid, a promise function.
For example, in the current project directory, want to gitpacker
and exclude all .sh
and .md
files:
gitpacker zip name.zip . -e '*.sh' -e '*.md'
Or only want to gitpacker
the all .js
files in ./lib
directory:
gitpacker zip name.zip lib -i '*.js'
Welcome your Star, make pull requests, report bugs, suggest ideas and discuss gitpacker.js.
I would love to hear what you think about gitpacker.js on issues page.
Your support is my unremitting power.