Socket
Socket
Sign inDemoInstall

git-root

Package Overview
Dependencies
18
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    git-root

A tool to get the git root path


Version published
Weekly downloads
91
increased by127.5%
Maintainers
1
Install size
472 kB
Created
Weekly downloads
 

Readme

Source

git-root

Build Status Build status Coverage Status

Get synchronously the git root path

Installation

$ npm i git-root --save

or

$ yarn add git-root

Usage

Returns:

  • String: The git root or empty string if it is not a git repository
const gitRoot = require('git-root');

gitRoot(); // '' or git root of process.cwd()
gitRoot('any/git/repo'); // '' or git root of the directory 'any/git/repo'

LICENSE

MIT © Jan Peer Stöcklmair

Keywords

FAQs

Last updated on 24 Dec 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc