WindomZ / gitpacker.js

A tool to quickly pack and compress git repository.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gitpacker.js

Greenkeeper badge Build Status Coverage Status Dependency Standard - JavaScript Style Guide Minimum Node.js Version

A tool to quickly pack and compress the pure git repository.

NPM

gitpacker status

Features

  • 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.

Install

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 <file>  include file
    -e, --exclude <file>  exclude file
    --debug               debug mode, such as print error tracks

API Usage

const compress = require('gitpacker')

compress (method:string, directory:string, compress:string, includes:Array, excludes:Array)

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.

compress.promise (method:string, directory:string, compress:string, includes:Array, excludes:Array)

Ibid, a promise function.

Example

CLI Example

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 .jsfiles in ./lib directory:

gitpacker zip name.zip lib -i '*.js'

Support

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.

About

A tool to quickly pack and compress git repository.

License:Apache License 2.0


Languages

Language:JavaScript 98.8%Language:Shell 1.2%