1.0.2 • Published 7 years ago

gitd v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

Gitd Build Status Standard - JavaScript Style Guide Greenkeeper badge

Use Git to fetch all directories and 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

NameRequiredDescription
repositoryRequiredGit repository URL.
directoryRequiredEmpty directory path. (Git could create the directory if not exists)
branchOptionalmaster by default. You can also provide a tag name.

License

MIT license

© 2017 José Luis Quintana