# this-commit

> Get the current commit name

Latest version **1.0.0** (published 2015-01-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install this-commit
pnpm add this-commit
yarn add this-commit
bun add this-commit
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-01-25 |
| First published | 2015-01-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Sitegui |
| Maintainers | sitegui |
| Keywords | git, rev-parse, commit |

## Links

- npm: https://www.npmjs.com/package/this-commit
- Repository: https://github.com/sitegui/this-commit
- Issues: https://github.com/sitegui/this-commit/issues
- npm.io page: https://npm.io/package/this-commit

## Recent versions

- 1.0.0 (latest) — 2015-01-25

## README

# This Commit

Get the current commit name

## Install
`npm install this-commit --save`

## Usage

```js
var commit = require('this-commit')()
// commit is a string like '5cdb9922ab793900847a3c3801831f1f242be11b'
// or '' if could not found

var commit = require('this-commit').asBuffer()
// commit is a Buffer instance (or null)
```

Both forms accept as an optional argument the '.git' folder. By default, it will be found by walking up from the current working dir.

## Features
* Read from `.git` folder on disk, do not execute `git`
* Work from sub-dirs, will look for `.git` on parent directories
* Support for detached head
* Support for packed refs

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