New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@bung87/gitzip

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bung87/gitzip

Archives ignoring files from gitignore

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

:zipper_mouth_face: gitzip

This module provides a gitzip command that creates zip file ignoring files from .gitignore file.

If the source folder doesn't contain .gitignore then all files will be zipped.

:bulb: Useful to share the current changes while working on git repository. It complements the git archive where you don't need to commit or stash the changes to create untracked changed file.

Global command line usage

npm install -g gitzip

go to the folder you want to zip and run

gitzip

This will generate submission.zip

Command line usage within package.json scripts

npm install --save-dev gitzip

package.json:

{
    //...
    "scripts": {
        "build" "...",
        "zip": "gitzip -d bundle.zip -s build/*",
        "upload": "....",
        "deploy": "npm run build && npm run zip && npm run upload"
    }
}

Programmatic usage from within Node.js

var zip = require('gitzip');

zip({
  source: 'build/*',
  destination: './destination.zip',
  exclude: ['destination.zip'],
  include: ['.git']
}).then(function() {
  console.log('all done!');
}).catch(function(err) {
  console.error(err.stack);
  process.exit(1);
});

Options

source[-s]

* Type: `string`
* Default: `.` current directory

Path to files and folders to include in the zip file. String or Array of Strings. Defaults to current path.

destination

* Type: `string`
* Default: `submission.zip` at current directory

Path to generated .zip file. Defaults to submission.zip in current path.

exclude

* Type: `string[]`

Array of strings of file pattern to exclude from zip

include

* Type: `string[]`

Array of strings of file pattern to include in zip.

Note, include has more precedence than exclude

Node Version

Node 8 or greater

License

This software is released under the terms of the MIT license.

Keywords

git

FAQs

Package last updated on 18 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts