Giter Club home page Giter Club logo

gitzip's Introduction

gitzip

demo site

demo site: Usage of download link via Parameters

demo site: Get access token steps

Browser Extension: Chrome Extension, Firefox Addon

Description

It can make sub-folder/sub-directory of github repository as zip and download it.

You can now use the API if you would like to incorporate this into your own website. Clone this repository so that you will have the appropriate files. Then just call the API. Enjoy.

Main features

  • Get file from repo url
  • Get zip from repo url
  • Get zip from repo sub-directory url

Usage

Get Zip from repo root/sub-directory/file url

GitZip.zipRepo(pathToFolder[, callbackScope])
Parameters
Name Type Description
pathToFolder string The URL of the Github repository.
callbackScope object The scope of the progressCallback function. If you has registered callback, the code will execute like this: yourcallback.apply(callbackScope, arguments)
Example
GitZip.zipRepo("https://github.com/KinoLien/gitzip");
GitZip.zipRepo("https://github.com/KinoLien/gitzip/tree/master/js");
GitZip.zipRepo("https://github.com/KinoLien/gitzip/tree/master/");
GitZip.zipRepo("https://github.com/KinoLien/gitzip/blob/master/example.html");
GitZip.zipRepo("https://github.com/KinoLien/gitzip/tree/gh-pages/css");
...

Register progress callback

GitZip.registerCallback(inputFn);
Parameters
Name Type Description
inputFn function The callback will be called when fetch files, zipping, error occur and so on.
Progress Callback Parameters
Name Type Description
status string Indicates the status description like 'error', 'prepare', 'processing', 'done'.
message string The messages of the above status.
percent number From 0 to 100, indicates the progress percentage. (debugging)

License

Released under the MIT license.

gitzip's People

Contributors

kinolien avatar kennethgoodman avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.