https://github.com/nodejs/package-compliant
Validate the `support` property in the `package.json`
https://github.com/nodejs/package-compliant
package package-json validation
Last synced: 11 days ago
JSON representation
Validate the `support` property in the `package.json`
- Host: GitHub
- URL: https://github.com/nodejs/package-compliant
- Owner: nodejs
- License: mit
- Archived: true
- Created: 2019-02-26T21:05:45.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2021-05-31T15:20:04.000Z (over 4 years ago)
- Last Synced: 2024-10-29T16:13:24.603Z (12 months ago)
- Topics: package, package-json, validation
- Language: JavaScript
- Size: 23.4 KB
- Stars: 10
- Watchers: 4
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
THIS REPO IS ARHIVED.
# package-compliant
[](https://standardjs.com)
[](https://travis-ci.com/Eomm/package-compliant)Validate the `support` property in the `package.json` following the [package-maintenance guidelines][validation]!
⚠ This project has been deprecated. Use [`@pkgjs/support`](https://github.com/pkgjs/support) instead.
## 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 ]
```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!
## License
Licensed under [MIT](./LICENSE).
[validation]: https://raw.githubusercontent.com/nodejs/package-maintenance/781a6bb752f4928e9e5e916b10ba38eb5289f316/docs/drafts/Baseline%20practive%20-%20Document%20support%20levels.md