is-git-clean
Version:
Find out if a git directory is clean or not
63 lines (35 loc) • 1.2 kB
Markdown
> Find out if a git directory is clean or not
```
$ npm install --save is-git-clean
```
```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()
```
Returns a promise for a `boolean` value. `true` if the directory is clean, `false` if it is not.
Type: `string` <br>
Default: `process.cwd()`
Path to the directory you want to check.
Type: `object`
Type: `array`
An array of [`multimatch`](https://github.com/sindresorhus/multimatch) patterns to ignore certain files.
Synchronous version, with the same API as above. Returns a boolean directly, instead of a Promise.
MIT © [James Talmage](http://github.com/jamestalmage)