check-git-clean
v1.0.0
Published
Check the cleanliness of a Git working directory, identifying untracked, unstaged, and uncommitted changes
Downloads
58
Maintainers
Readme
check-git-clean
Check the cleanliness of a Git working directory, identifying untracked, unstaged, and uncommitted changes.
Install
Using pnpm:
pnpm add check-git-clean
Using yarn:
yarn add check-git-clean
Using npm:
npm install check-git-clean
Usage
import { checkGitClean } from 'check-git-clean'
/**
* Check if a local git repository is clean.
* Ignore files defined in [git-ignore-patterns](git-ignore-patterns),
* which contains commonly git-ignored files for node project.
* @param dir (optional). Default to `process.cwd()`
* @return Object { `isClean`, `untracked`, `unstaged`, `uncommitted` }
*/
const { isClean, untracked, unstaged, uncommitted } = await checkGitClean()
Authors
👤 GloryWong
- Website: https://glorywong.com
- GitHub: @GloryWong
Show Your Support
Give a ⭐️ if this project helped you!