# package-compliant

> Validate the `support` property in the `package.json`

Latest version **1.1.1** (published 2019-05-21) · MIT license · 0 weekly downloads

## Install

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

Provides the command `package-compliant`.

## 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.1.1 |
| Published | 2019-05-21 |
| First published | 2019-03-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 4 |
| Unpacked size | 15.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Manuel Spigolon |
| Maintainers | eomm |
| Keywords | package, package-json, validation, support |

## Links

- npm: https://www.npmjs.com/package/package-compliant
- Repository: https://github.com/Eomm/package-compliant
- Homepage: https://github.com/Eomm/package-compliant#readme
- Issues: https://github.com/Eomm/package-compliant/issues
- npm.io page: https://npm.io/package/package-compliant

## Dependencies (4)

- [ajv](https://npm.io/package/ajv.md) ^6.9.2
- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [commist](https://npm.io/package/commist.md) ^1.1.0
- [yargs-parser](https://npm.io/package/yargs-parser.md) ^13.0.0

## 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.1.1 (latest) — 2019-05-21
- 1.1.0 — 2019-05-21
- 1.0.1 — 2019-03-07
- 1.0.0 — 2019-03-07

## README

# package-compliant

[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![Build Status](https://travis-ci.com/Eomm/package-compliant.svg?branch=master)](https://travis-ci.com/Eomm/package-compliant)

Validate the `support` property in the `package.json` following the [package-maintenance guidelines][validation]!


## Install

You can use this package as a CLI or as a Module if you need to use the core function of this module.

```
// As a CLI
npm i package-compliant -g

// As a module
npm i package-compliant
```

## Commands

To run the commands you can execute:

```sh
package-compliant validate --file ./package-custom.json
// or simply in a project folder
package-compliant validate

// npx is supported of course
npx package-compliant validate
```

### Validate

```sh
package-compliant validate [--file|-f <file path>]
```

Validation applied:

+ ✔ Validate `support` property of the JSON `--file` if it exists. The default `--file` is the `package.json` in the directory where the command is executed.


## Module

To use this package as a module you need to:

```js
const packageCompliant = require('package-compliant')
const aPackageJson = require('./package.json')

try {
  packageCompliant.validateSupportField(aPackageJson.support)
  // the package is valid
} catch (err) {
  // the package has some errors
}

// or you can use callback:
packageCompliant.validateSupportField(aPackageJson.support, (err, valid) => {
  if (err) {
    // there are some errors!!
  }
})
```


## Contributions

Read the [CONTRIBUTING](./CONTRIBUTING.md) guidelines to start help us!

### Add new commands

+ Add to `commands` array in `lib\index.js` the command name (Ex: `awesome`)
+ Create a `lib/commands/<command name>.js` file that expose this API `module.exports = function (args) { /* YOUR CODE */ }`
+ Create a `man/<command name>` file with all the information to run the command
+ Create a `test/<command name>.test.js` where you test your command


## License

Copyright [Manuel Spigolon](https://github.com/Eomm), Licensed under [MIT](./LICENSE).


[validation]: https://raw.githubusercontent.com/nodejs/package-maintenance/781a6bb752f4928e9e5e916b10ba38eb5289f316/docs/drafts/Baseline%20practive%20-%20Document%20support%20levels.md

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