# req-package-json

> Load and parse nearest package.json.

Latest version **2.1.4** (published 2023-05-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install req-package-json
pnpm add req-package-json
yarn add req-package-json
bun add req-package-json
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.4 |
| Published | 2023-05-22 |
| First published | 2021-01-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Maximilian Mairinger |
| Maintainers | zzrv |
| Keywords | request, package.json, load, package, json, config |

## Links

- npm: https://www.npmjs.com/package/req-package-json
- Repository: https://github.com/maximilianMairinger/reqPackageJson
- Homepage: https://github.com/maximilianMairinger/reqPackageJson#readme
- Issues: https://github.com/maximilianMairinger/reqPackageJson/issues
- npm.io page: https://npm.io/package/req-package-json

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 2.1.4 (latest) — 2023-05-22
- 2.1.3 — 2023-05-08
- 2.1.2 — 2023-05-07
- 2.1.1 — 2023-05-07
- 2.1.0 — 2021-01-06
- 2.0.2 — 2021-01-06
- 2.0.1 — 2021-01-06
- 2.0.0 — 2021-01-06
- 1.0.2 — 2021-01-06
- 1.0.1 — 2021-01-05
- 1.0.0 — 2021-01-05
- 0.0.1 — 2021-01-05

## README

# Require package.json

Load and parse the nearest package.json, relative to the callers directory.

## Installation

```shell
 $ npm i req-package-json
```

## Usage


```ts
import reqPackageJson from "req-package-json"

console.log(reqPackageJson()) // {name: "whatever", version: "1.0.0"}
```

### Advanced

```ts
import { reqPackageJson } from "req-package-json"

reqPackageJson() // relative to current dir (where the function is called)
reqPackageJson("dir/where/to/start/searching") // relative to given dir
```

## Contribute

All feedback is appreciated. Create a pull request or write an issue.

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