is-inside-git
v1.0.2
Published
Check if a file or directory is inside a git repository
Downloads
5
Maintainers
Readme
is-inside-git
About
Check if a file or directory is inside a git repository.
Installation
npm install --save is-inside-git
Usage
const { isInsideGit, isInsideGitSync } = require('is-inside-git');
// defaults to process.cwd();
const dirPathname = 'nested';
const filePathname = 'file.js';
// async
const dirInsideGit: boolean = await isInsideGit(dirPathname);
const fileInsideGit: boolean = await isInsideGit(filePathname);
// sync
const dirInsideGit: boolean = isInsideGitSync(dirPathname);
const fileInsideGit: boolean = isInsideGitSync(filePathname);