1.0.0 • Published 8 years ago

package-schema v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

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