is-git-clean
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/is-git-clean package

1.1.0 • Public • Published

is-git-clean Build Status

Find out if a git directory is clean or not

Install

$ npm install --save is-git-clean

Usage

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
Default: process.cwd()

Path to the directory you want to check.

options

Type: object

files

Type: array

An array of 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

Readme

Keywords

Package Sidebar

Install

npm i is-git-clean

Weekly Downloads

34,495

Version

1.1.0

License

MIT

Last publish

Collaborators

  • jamestalmage