# gitd

> Use git to fetch all directories and files from any repository.

Latest version **1.0.2** (published 2017-04-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install gitd
pnpm add gitd
yarn add gitd
bun add gitd
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2017-04-06 |
| First published | 2017-02-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 4.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Jose Luis Quintana |
| Maintainers | joseluisq |
| Keywords | git, fetch, files, clone, tag, branch, promise, download |

## Links

- npm: https://www.npmjs.com/package/gitd
- Repository: https://github.com/joseluisq/gitd
- Homepage: https://github.com/joseluisq/gitd#readme
- Issues: https://github.com/joseluisq/gitd/issues
- npm.io page: https://npm.io/package/gitd

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2017-04-06
- 1.0.1 — 2017-02-05
- 1.0.0 — 2017-02-04

## README

# Gitd [![Build Status](https://travis-ci.org/joseluisq/gitd.svg?branch=master)](https://travis-ci.org/joseluisq/gitd) [![Standard - JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/) [![Greenkeeper badge](https://badges.greenkeeper.io/joseluisq/gitd.svg)](https://greenkeeper.io/)

> Use [Git](https://git-scm.com/) to fetch all directories and files from any repository. :octocat:

## Prerequisites

- [NodeJS](https://nodejs.org) v4.0 or greater.
- [Git](https://git-scm.com/).
- Unix-like operating systems only (this package uses a shell script).

## Install

[Yarn](https://github.com/yarnpkg/)

```sh
yarn add gitd --dev
```

[NPM](https://www.npmjs.com/)

```sh
npm install gitd --save-dev
```

## Usage

`gitd` returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) object. When promise is fulfilled the `directory` value is passed else when it is `rejected` an `Error` object is passed.

```js
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](http://quintana.io)

---
_Source: https://npm.io/package/gitd · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
