# find-project-root

> Finds project root

Latest version **1.1.1** (published 2015-08-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install find-project-root
pnpm add find-project-root
yarn add find-project-root
bun add find-project-root
```

Provides the command `find-project-root`.

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2015-08-18 |
| First published | 2015-08-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | separate (@types/find-project-root) |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | kirstein |
| Maintainers | kirstein |

## Links

- npm: https://www.npmjs.com/package/find-project-root
- npm.io page: https://npm.io/package/find-project-root

## Recent versions

- 1.1.1 (latest) — 2015-08-18
- 1.1.0 — 2015-08-18
- 1.0.1 — 2015-08-18
- 1.0.0 — 2015-08-18

## README

# find-project-root [![Build Status](https://secure.travis-ci.org/kirstein/find-project-root.png?branch=master)](https://travis-ci.org/kirstein/find-project-root)

> Finds the project root by custom markers

### Getting started

1. As a binary  
    ```
      $ npm install find-project-root -g
      $ pwd
        /Users/kirstein/workspace/github/kirstein/find-project-root/test
      $ find-project-root
        /Users/kirstein/workspace/github/kirstein/find-project-root
    ```

2. As a node module

    ```
      $ npm install find-project-root
      var findProjectRoot = require('find-project-root');
      // magic
    ```

### What?

Traverses top-down of the project tree starting from a specific path and searches for known markers that indicate project starting point. 

Markers:  

  * .hg
  * .git

### API

`findProjectRoot(path, {options});`

options:  

  * maxDepth - int - total number of levels the algorithm can traverse  
    **default**: 9  
  * markers - [ 'str' ] - markers that it will search for  
    **default**: [ '.hg', '.git' ]
  
  
##### Example:

```
  var findProjectRoot = require('find-project-root');
  var root = findProjectRoot(process.cwd(), {
    maxDepth: 12
  });
```

---
_Source: https://npm.io/package/find-project-root · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
