Skip to content
/ gitd Public

Use Git to fetch all source files from any repository. :octocat:

License

Notifications You must be signed in to change notification settings

joseluisq/gitd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gitd Build Status Standard - JavaScript Style Guide Greenkeeper badge

Use Git to fetch all source files from any repository. :octocat:

Prerequisites

  • NodeJS v4.0 or greater.
  • Git.
  • Unix-like operating systems only (this package uses a shell script). 🐧

Install

Yarn

yarn add gitd --dev

NPM

npm install gitd --save-dev

Usage

gitd returns a Promise object. When promise is fulfilled the directory value is passed else when it is rejected an Error object is passed.

const gitd = require('gitd')

gitd({
  repository: 'https://github.com/joseluisq/gitd.git',
  directory: '.tmp',
  branch: 'master',
})
.then(dir => console.log(`Files downloaded at "${dir}"`))
.catch(err => console.error(err.message))

Options

Name Required Description
repository Required Git repository URL.
directory Required Empty directory path. (Git could create the directory if not exists)
branch Optional master by default. You can also provide a tag name.

License

MIT license

© 2017 José Luis Quintana