Use Git to fetch all source files from any repository. :octocat:
Use Git to fetch all source files from any repository.
yarn add gitd --dev
npm install gitd --save-dev
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))
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. |
MIT license
© 2017 José Luis Quintana