# pkg-check

> 检查本地包与package.json依赖包版本一致性

Latest version **1.0.17** (published 2021-09-10) · ISC license · 0 weekly downloads

## Install

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

## 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 | 1.0.17 |
| Published | 2021-09-10 |
| First published | 2021-01-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 19 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | chenziheng |
| Maintainers | swiftdczh |
| Keywords | pkg-check |

## Links

- npm: https://www.npmjs.com/package/pkg-check
- Repository: https://github.com/sasikeya/pkg-check
- Homepage: https://github.com/sasikeya/pkg-check#readme
- Issues: https://github.com/sasikeya/pkg-check/issues
- npm.io page: https://npm.io/package/pkg-check

## Dependencies (6)

- [ora](https://npm.io/package/ora.md) ^5.3.0
- [axios](https://npm.io/package/axios.md) ^0.21.1
- [chalk](https://npm.io/package/chalk.md) ^4.0.0
- [commander](https://npm.io/package/commander.md) ^7.0.0
- [alphabetjs](https://npm.io/package/alphabetjs.md) ^0.1.4
- [package-json](https://npm.io/package/package-json.md) ^6.5.0

## Recent versions

- 1.0.17 (latest) — 2021-09-10
- 1.0.16 — 2021-07-07
- 1.0.15 — 2021-02-23
- 1.0.14 — 2021-02-23
- 1.0.13 — 2021-02-21
- 1.0.12 — 2021-02-05
- 1.0.11 — 2021-02-05
- 1.0.10 — 2021-02-05
- 1.0.9 — 2021-02-05
- 1.0.8 — 2021-02-05
- 1.0.7 — 2021-02-02
- 1.0.6 — 2021-02-02
- 1.0.5 — 2021-02-01
- 1.0.4 — 2021-02-01
- 1.0.3 — 2021-02-01
- … 12 more at https://npm.io/package/pkg-check/versions

## README

# pkg-check
检查本地包与package.json依赖包版本一致性

# 使用场景
适用于本地打包发版，可配置某些依赖包严格根据package版本打包，对于某个依赖包经常更新但本地未更新的场景

# 安装
```
npm install pkg-check -D
```
### 环境
* Node >= 8


# 使用配置
```
const pkgCheck = require('pkg-check')


API  start 方法

start 会自动安装依赖
const config? = {
  dependencies?: [opt], string or Object 指定监控的包
  packagePath?: '' package.json 相对与根目录路径
}

xxx 通过命令行获取参数对应自定义环境的版本
opt = {
  name: 'xx',   依赖名称
  ['xxx']: '1.0.0',
  env: 'test' 环境
  origin: 'npm', 依赖来源
  autoUpdate: true  true代表每次检查都会检查最新版本 如果有新版就安装最新版本
}

pkgCheck.start(config) 


API check 方法
check 只是检查版本

pkgCheck.check(config) 

const config = {
  dependencies: [''], 字符串类型 string 指定监控的包 
  packagePath?: '' package.json 相对与根目录路径
}

check 类型Promise 返回的需要安装依赖的信息 
[{dependencies:xxx, version: xxx}]

```

# 后续支持

- [x] 支持环境控制 安装依赖版本号
- [x] 支持自动安装最新版本依赖

## License
MIT.

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