Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

is-git-repository

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-git-repository

A tool to check if a specific path is a git repository

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
306K
decreased by-9.82%
Maintainers
1
Weekly downloads
 
Created

What is is-git-repository?

The is-git-repository npm package is a utility that allows you to check if a given directory is a Git repository. It is useful for scripts and tools that need to verify the presence of a Git repository before performing certain operations.

What are is-git-repository's main functionalities?

Check if a directory is a Git repository

This feature allows you to check if a specified directory is a Git repository. The function takes a path and a callback function. The callback function receives an error object and a boolean indicating whether the directory is a Git repository.

const isGitRepo = require('is-git-repository');

const path = '/path/to/directory';

isGitRepo(path, (err, result) => {
  if (err) {
    console.error(err);
  } else {
    console.log(result ? 'This is a Git repository' : 'This is not a Git repository');
  }
});

Other packages similar to is-git-repository

Keywords

FAQs

Package last updated on 23 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc