# async-git

> 👾 Retrieve data from current git repository

Latest version **1.13.3** (published 2021-12-30) · Unlicense license · 0 weekly downloads

## Install

```sh
npm install async-git
pnpm add async-git
yarn add async-git
bun add async-git
```

## 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.13.3 |
| Published | 2021-12-30 |
| First published | 2018-06-06 |
| Weekly downloads | 0 |
| License | Unlicense |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 12.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | omrilotan |
| Maintainers | omrilotan |
| Keywords | git, github, bitbucket, gitlab, info, async, promise, commit, branch, author, git log, source control, 🐙 |

## Links

- npm: https://www.npmjs.com/package/async-git
- Repository: https://github.com/omrilotan/async-git
- Homepage: https://omrilotan.com/async-git/
- Issues: https://github.com/omrilotan/async-git/issues
- npm.io page: https://npm.io/package/async-git

## Dependencies (1)

- [@does/exist](https://npm.io/package/@does/exist.md) ^1.1.0

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 1.13.3 (latest) — 2021-12-30
- 1.13.2 — 2021-01-24
- 1.13.1 — 2021-01-20
- 1.13.0 — 2020-03-10
- 1.12.0 — 2020-01-05
- 1.11.0 — 2019-12-16
- 1.10.1 — 2019-11-06
- 1.10.0 — 2019-11-06
- 1.9.0 — 2019-11-04
- 1.8.0 — 2019-10-23
- 1.7.0 — 2019-10-23
- 1.6.1 — 2019-07-30
- 1.6.0 — 2019-07-03
- 1.5.1 — 2019-04-30
- 1.5.0 — 2019-04-07
- … 8 more at https://npm.io/package/async-git/versions

## README

# async-git [![](https://img.shields.io/npm/v/async-git.svg)](https://www.npmjs.com/package/async-git)

## 👾 Retrieve data from current git repository

[![](https://github.com/omrilotan/async-git/workflows/publish/badge.svg)](https://github.com/omrilotan/async-git/actions) [![](https://img.shields.io/badge/source--000000.svg?logo=github&style=social)](https://github.com/omrilotan/async-git)

\* Getter properties are async (getters) [more on async properties](https://dev.to/omrilotan/javascript-apis-with-async-properties-5ag7)

```js
const git = require('async-git');

`${await git.author} committed ${await git.message}` // Omri committed Some changes
```

## Getters

| Property | Type | Description | Example
| - | - | - | -
| `author` | string | Author name of the last commit | `await git.author`
| `body` | string | Most recent commit message body | `await git.body`
| `branch` | string | Current branch name | `await git.branch`
| `changed` | string[] | List of files changed in last commit | `await git.changed`
| `comitter` | string | Comitter name of the last commit | `await git.comitter`
| `date` | Date | Date of the last change | `await git.date`
| `email` | string | Author email of the last commit | `await git.email`
| `message` | string | Most recent commit full message (subject and body) | `await git.message`
| `name` | string | Project name | `await git.name`
| `origin` | string | Remote origin URL | `await git.origin`
| `owner` | string | Remote repository owner | `await git.owner`
| `sha` | string | Unique identifier of the last commit | `await git.sha`
| `short` | string | 7 Character Unique identifier of the last commit | `await git.short`
| `staged` | string[] | List of staged files | `await git.staged`
| `subject` | string | Most recent commit subject | `await git.subject`
| `tags` | string[] | List of tags | `await git.tags`
| `unadded` | string[] | List of files that would be added or removed by 'git add' | `await git.unadded`
| `unstaged` | string[] | List of unstaged files | `await git.unstaged`
| `untracked` | string[] | List of untracked files | `await git.untracked`
| `version` | string | Get git version (semver) | `await git.version`

## Functions

### `modified`
Get the last modified date of a file
```js
await modified('./index.js')
```

| Argument | Return value
| - | -
| `{string}` Path to file | `{Date}` Last modified date

### `reset`
Reset current HEAD to the specified destination
```js
await git.reset(1) // reset number of commit back
await git.reset('f5db755') // reset to specific SHA ID
```

| Argument | Return value
| - | -
| `{string\|number}` State ID | `{void}` nothing

### `tag`
Create a tag using the last commit message
```js
await git.tag('1.2.3')
```

| Argument | Return value
| - | -
| `{string}` Version | `{void}` nothing

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