项目作者: joseluisq

项目描述 :
Use Git to fetch all source files from any repository. :octocat:
高级语言: JavaScript
项目地址: git://github.com/joseluisq/gitd.git
创建时间: 2017-02-04T13:11:24Z
项目社区:https://github.com/joseluisq/gitd

开源协议:MIT License

下载


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). :penguin:

Install

Yarn

  1. yarn add gitd --dev

NPM

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

  1. const gitd = require('gitd')
  2. gitd({
  3. repository: 'https://github.com/joseluisq/gitd.git',
  4. directory: '.tmp',
  5. branch: 'master',
  6. })
  7. .then(dir => console.log(`Files downloaded at "${dir}"`))
  8. .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