package-schema
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 = ;
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
: