# is-git-clean

> Find out if a git directory is clean or not

Latest version **1.1.0** (published 2016-09-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-git-clean
pnpm add is-git-clean
yarn add is-git-clean
bun add is-git-clean
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2016-09-21 |
| First published | 2016-04-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/is-git-clean) |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | James Talmage |
| Maintainers | jamestalmage |
| Keywords | git, clean |

## Links

- npm: https://www.npmjs.com/package/is-git-clean
- Repository: https://github.com/jamestalmage/is-git-clean
- Homepage: https://github.com/jamestalmage/is-git-clean#readme
- Issues: https://github.com/jamestalmage/is-git-clean/issues
- npm.io page: https://npm.io/package/is-git-clean

## Dependencies (3)

- [execa](https://npm.io/package/execa.md) ^0.4.0
- [is-obj](https://npm.io/package/is-obj.md) ^1.0.1
- [multimatch](https://npm.io/package/multimatch.md) ^2.1.0

## Recent versions

- 1.1.0 (latest) — 2016-09-21
- 1.0.0 — 2016-04-06

## README

# is-git-clean [![Build Status](https://travis-ci.org/jamestalmage/is-git-clean.svg?branch=master)](https://travis-ci.org/jamestalmage/is-git-clean)

> Find out if a git directory is clean or not


## Install

```
$ npm install --save is-git-clean
```


## Usage

```js
const isGitClean = require('is-git-clean');

isGitClean().then(clean => console.log(clean));
//=> true || false

// alternate directory
isGitClean('/some/path')

// options
// `ignore.txt` is ignored and not counted as dirty
isGitClean('/some/path', {files: ['!ignore.txt']})

// sync version
isGitClean.sync()
```


## API

### isGitClean([dir], [options])

Returns a promise for a `boolean` value. `true` if the directory is clean, `false` if it is not.

#### dir

Type: `string` <br>
Default: `process.cwd()`

Path to the directory you want to check.

#### options

Type: `object`

##### files

Type: `array`

An array of [`multimatch`](https://github.com/sindresorhus/multimatch) patterns to ignore certain files.

### isGitClean.sync([dir], [options])

Synchronous version, with the same API as above. Returns a boolean directly, instead of a Promise.

## License

MIT © [James Talmage](http://github.com/jamestalmage)

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