# pkg-has

> Just checking if package.json contains a given package.

Latest version **1.0.7** (published 2018-04-05) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install pkg-has
pnpm add pkg-has
yarn add pkg-has
bun add pkg-has
```

Provides the command `pkghas`.

## 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.7 |
| Published | 2018-04-05 |
| First published | 2018-04-05 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 15.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | vdegenne |
| Keywords | package, pkg-has, util |

## Links

- npm: https://www.npmjs.com/package/pkg-has
- Repository: https://github.com/vdegenne/pkg-has
- npm.io page: https://npm.io/package/pkg-has

## Dependencies (8)

- [colors](https://npm.io/package/colors.md) ^1.2.1
- [plylog](https://npm.io/package/plylog.md) ^0.4.0
- [resolve](https://npm.io/package/resolve.md) ^1.6.0
- [@types/node](https://npm.io/package/@types/node.md) ^9.6.1
- [@types/colors](https://npm.io/package/@types/colors.md) ^1.2.1
- [@types/resolve](https://npm.io/package/@types/resolve.md) ^0.0.7
- [command-line-args](https://npm.io/package/command-line-args.md) ^5.0.2
- [command-line-usage](https://npm.io/package/command-line-usage.md) ^5.0.4

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 1.0.7 (latest) — 2018-04-05
- 1.0.6 — 2018-04-05
- 1.0.5 — 2018-04-05
- 1.0.4 — 2018-04-05
- 1.0.2 — 2018-04-05
- 1.0.1 — 2018-04-05

## README

[![Build Status](https://travis-ci.org/vdegenne/pkg-has.svg)](https://travis-ci.org/vdegenne/pkg-has)
[![npm](https://img.shields.io/npm/v/pkg-has.svg)](https://www.npmjs.com/package/pkg-has)

# pkg-has

Just checking if package.json contains a given package.

## Usage

```javascript
does_my_project_have_mocha = require('pkg-has')('mocha');
```

or use a wide search

```javascript
const findings = require('pkg-has').wideSearch('cha');
// findings = ["mocha", "chai"]
```

**installation :** `yarn add pkg-has`

## Command-line Usage

```sudo yarn global add pkg-has```

<img src="https://github.com/vdegenne/pkg-has/blob/master/pkghas.png?raw=true"/>

## notes

it will test against the `package.json` based on the current position, so if you are in a directory of your project it will test with your `package.json` as you would expect. But now if you are in a dependency directory structure (e.g. `./node_modules/chai`), it will test against this dependency `package.json`. So beware.

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