git-dir-up
Find the closest .git
directory
Useful for tools that need to know whether git
is managing the things inside.
Installation
npm install --save git-dir-up
Usage
/└── Users └── luftywiranda └── foo ├── .git └── bar ├── baz └── example.js
// example.jsconst gitDirUp = ; ;
API
gitDirUp([cwd])
Returns Promise<string>
for the path of .git
or null
if no .git
dir found.
cwd
Type: string
Default: process.cwd()
Directory to start from.
Related
- git-root-dir – Find the root path of a git project
- pkg-dir – Find the root directory of a Node.js project or npm package
License
MIT © Lufty Wiranda