项目作者: nodejs

项目描述 :
Validate the `support` property in the `package.json`
高级语言: JavaScript
项目地址: git://github.com/nodejs/package-compliant.git
创建时间: 2019-02-26T21:05:45Z
项目社区:https://github.com/nodejs/package-compliant

开源协议:MIT License

下载


THIS REPO IS ARHIVED.

package-compliant

JavaScript Style Guide
Build Status

Validate the support property in the package.json following the package-maintenance guidelines!

⚠ This project has been deprecated. Use @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.

  1. // As a CLI
  2. npm i package-compliant -g
  3. // As a module
  4. npm i package-compliant

Commands

To run the commands you can execute:

  1. package-compliant validate --file ./package-custom.json
  2. // or simply in a project folder
  3. package-compliant validate
  4. // npx is supported of course
  5. npx package-compliant validate

Validate

  1. 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:

  1. const packageCompliant = require('package-compliant')
  2. const aPackageJson = require('./package.json')
  3. try {
  4. packageCompliant.validateSupportField(aPackageJson.support)
  5. // the package is valid
  6. } catch (err) {
  7. // the package has some errors
  8. }
  9. // or you can use callback:
  10. packageCompliant.validateSupportField(aPackageJson.support, (err, valid) => {
  11. if (err) {
  12. // there are some errors!!
  13. }
  14. })

Contributions

Read the CONTRIBUTING guidelines to start help us!

License

Licensed under MIT.