# git-utils-node

> git utils for node js

Latest version **1.1.4** (published 2021-01-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install git-utils-node
pnpm add git-utils-node
yarn add git-utils-node
bun add git-utils-node
```

## 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.1.4 |
| Published | 2021-01-21 |
| First published | 2020-09-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | tenglei |
| Maintainers | tenglei |
| Keywords | git, utils, nodejs |

## Links

- npm: https://www.npmjs.com/package/git-utils-node
- Repository: https://github.com/xiaoyueqingfeng/git-utils-node
- Homepage: https://github.com/xiaoyueqingfeng/git-utils-node#readme
- Issues: https://github.com/xiaoyueqingfeng/git-utils-node/issues
- npm.io page: https://npm.io/package/git-utils-node

## Recent versions

- 1.1.4 (latest) — 2021-01-21
- 1.1.3 — 2020-11-06
- 1.1.2 — 2020-11-02
- 1.1.1 — 2020-10-15
- 1.1.0 — 2020-10-15
- 1.0.9 — 2020-09-28
- 1.0.8 — 2020-09-28
- 1.0.7 — 2020-09-28
- 1.0.6 — 2020-09-28
- 1.0.5 — 2020-09-27
- 1.0.4 — 2020-09-27
- 1.0.3 — 2020-09-27
- 1.0.2 — 2020-09-27
- 1.0.1 — 2020-09-27
- 1.0.0 — 2020-09-27

## README

git-utils-node
============

Get current git commit hash, commit message, latest tag, branch and so on.

## Install

`npm install git-utils-node --save`

## Example

```js
const git = require('git-utils-node')

console.log(git.shortCommitHash()) // ef89de1

console.log(git.commitHash()) // ef89de12ce1aa5cd74866bf875e015eef42906f6

console.log(git.currentBranch()) // master

console.log(git.latestTagName()) // v3.0.1

console.log(git.userName()) // tenglei

console.log(git.conflicts()) // show conflict files

console.log(git.changedFiles()) // show changed files of last commit

console.log(git.remoteBranches()) // ['dev', 'master', 'test'] (show remote branches)

console.log(git.localBranches()) // ['dev', 'master'] (show local branches)

console.log(git.localMissingBranches()) // ['test'] (compare local branches with remote)
```

You can also run all these examples via: `npm run example`

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