Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vdegenne/pkg-has
Just checking if package.json contains a given package.
https://github.com/vdegenne/pkg-has
Last synced: about 2 months ago
JSON representation
Just checking if package.json contains a given package.
- Host: GitHub
- URL: https://github.com/vdegenne/pkg-has
- Owner: vdegenne
- Created: 2018-04-05T03:47:45.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-08T23:44:16.000Z (over 6 years ago)
- Last Synced: 2024-11-16T18:48:05.405Z (about 2 months ago)
- Language: TypeScript
- Size: 48.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
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```
## 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.