Skip to content
Determines whether a given path is a Git repository.
TypeScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.dependabot
src
.gitignore
.travis.yml
LICENSE
README.md
package.json
tsconfig.json
yarn.lock

README.md

Is Repo

Build Status install size npm version

Determines whether a given path is a Git repository. Uses git rev-parse --is-inside-work-tree.

Installation

yarn add is-repo
# or with npm
npm i is-repo

Usage

Very simple.

import isRepo from 'is-repo';

await isRepo(); // defaults to process.cwd()
await isRepo('path/to/repo'); // true || false
You can’t perform that action at this time.