package-schema
v1.0.0
Published
JSON Schema for node/npm package.json
Downloads
53
Readme
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 = 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"
}
}