Name Last Update
..
dist Loading commit data...
CHANGELOG.md Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
package.json Loading commit data...

npm node deps test coverage chat

Schema Utils

Install

npm install --save schema-utils

Usage

validateOptions

import validateOptions from 'schema-utils'

validateOptions('path/to/schema.json', options, 'Loader/Plugin Name')

Examples

Loader

import { getOptions } from 'loader-utils'
import validateOptions from 'schema-utils'

function loader (src, map) {
  const options = getOptions(this) || {}

  validateOptions('path/to/schema.json', options, 'Loader Name')
}

Plugin

import Tapable from 'tapable'
import validateOptions from 'schema-utils'

class Plugin extends Tapable {
  constructor (options) {
    validateOptions('path/to/schema.json', options, 'Plugin Name')
  }
}

Maintainers

Juho Vepsäläinen Joshua Wiens Michael Ciniawsky