1.0.0 • Published 9 years ago
package-schema v1.0.0
package-schema
JSON Schema for node/npm package.json
The JSON Schema is draft v4.
Installation
$ npm i package-schema --save-devUsage
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 packageOr 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
1.0.0
9 years ago