# read-package

> Reads package.json in the working directory

Latest version **1.0.2** (published 2020-05-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install read-package
pnpm add read-package
yarn add read-package
bun add read-package
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2020-05-08 |
| First published | 2017-06-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 1 |
| Unpacked size | 3.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Bu Kinoshita |
| Maintainers | bukinoshita |
| Keywords | npm, package, package.json, read, json |

## Links

- npm: https://www.npmjs.com/package/read-package
- Repository: https://github.com/bukinoshita/read-package
- npm.io page: https://npm.io/package/read-package

## Dependencies (1)

- [has-package](https://npm.io/package/has-package.md) 1.0.4

## 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

- 1.0.2 (latest) — 2020-05-08
- 1.0.1 — 2020-05-01
- 1.0.0 — 2020-01-07
- 0.0.1 — 2017-06-16

## README

# read-package [![Build Status](https://travis-ci.org/bukinoshita/read-package.svg?branch=master)](https://travis-ci.org/bukinoshita/read-package)

> Reads [package.json](https://docs.npmjs.com/files/package.json) in the working directory.

## Install

```
$ yarn add read-package
```

## Usage

```
.
├── foo
│   └── ...
└── bar
    └── package.json
```

```js
const readPackage = require('read-package')

readPackage('foo')
//=> package.json not found in the current project.

readPackage('bar')
//=> { "name": "fixture", "version": "1.0.0" }
```

## API

### readPackage([cwd])

Returns an `object` or `throws an error`.

#### cwd

Type: `string`<br>
Default: `process.cwd()`

Current working directory.

## Related

- [has-package](https://github.com/bukinoshita/has-package) — Check if a project has package.json

## License

MIT © [Bu Kinoshita](https://bukinoshita.io)

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