# find-nearest-package-json

> Find the nearest package.json by recursively crawling parent directories

Latest version **2.0.1** (published 2017-08-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install find-nearest-package-json
pnpm add find-nearest-package-json
yarn add find-nearest-package-json
bun add find-nearest-package-json
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2017-08-06 |
| First published | 2017-08-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Vinson Chuong |
| Maintainers | vinsonchuong |

## Links

- npm: https://www.npmjs.com/package/find-nearest-package-json
- Repository: https://github.com/vinsonchuong/find-nearest-package-json
- Issues: https://github.com/vinsonchuong/find-nearest-package-json/issues
- npm.io page: https://npm.io/package/find-nearest-package-json

## Recent versions

- 2.0.1 (latest) — 2017-08-06
- 2.0.0 — 2017-08-05
- 1.0.2 — 2017-08-04

## README

# find-nearest-package-json
[![Build Status](https://travis-ci.org/vinsonchuong/find-nearest-package-json.svg?branch=master)](https://travis-ci.org/vinsonchuong/find-nearest-package-json)

Find the nearest `package.json` by recursively crawling parent directories

## Usage
Install [find-nearest-package-json](https://yarnpkg.com/en/package/find-nearest-package-json)
by running

```sh
yarn add find-nearest-package-json
```

```js
import {
  findNearestPackageJson,
  findNearestPackageJsonSync
} from 'find-nearest-package-json'

async function runAsync() {
  const packageJsonNearestCwd = await findNearestPackageJson()
  const packageJsonNearestGivenDir = await findNearestPackageJson('/tmp/some-project/some-dir')

  console.log(packageJsonNearestGivenDir.path)
  console.log(packageJsonNearestGivenDir.data)
}

function runSync() {
  const packageJsonNearestCwd = findNearestPackageJsonSync()
  const packageJsonNearestGivenDir = findNearestPackageJsonSync('/tmp/some-project/some-dir')

  console.log(packageJsonNearestGivenDir.path)
  console.log(packageJsonNearestGivenDir.data)
}
```

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