package-schema

v1.0.0
JSON Schema for node/npm package.json
json schema json-schema package.json package npm

package-schema

NPM version Travis Build Status Dev Deps

JSON Schema for node/npm package.json

The JSON Schema is draft v4.

Installation

$ npm i package-schema --save-dev

Usage

The schema is located in the repo and has a name schema.json.

Get the schema as object:

const packageJsonSchema = require('package-schema');

Use the schema in any standard compliant CLI JSON Schema validator, for example using ajv-cli.

Run command if you installed ajv-cli and package-schema globally:

ajv -s /path/to/you/global/directory/with/node_modules/package-schema/schema -d package

Or add this command if you added ajv-cli and package-schema in package.json:

{
    "scripts": {
        "lint:package": "ajv -s node_modules/package-schema/schema -d package"
    }
}

Changelog

License

npm i package-schema

Metadata

  • MIT
  • Whatever
  • itgalaxy
  • released 8/31/2016

Downloads

Maintainers