JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 153802
  • Score
    100M100P100Q173101F
  • License MIT

recursively find the closest .git/

Package Exports

  • find-git-root

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (find-git-root) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

find-git-root

Recursively find the closest .git/ and return repo path

Installation

$ npm install find-git-root

Usage

'use strict'

const findGitRoot = require('find-git-root')

// git clone url /home/you/repo
const root = findGitRoot('/home/you/repo/somedir/somefile')
// => /home/you/repo/.git

const root = findGitRoot('/home/you/repo/somedir')
// => /home/you/repo/.git