New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

data-check

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

data-check

Convenience API/CLI to dereference a json-schema and validate data

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
1
Created
Source

data-check

npm license travis status Build status Coverage Status David David Commitizen friendly
NPM

Convenience method to wrap json-schema validation into a single function.

The single API method exported: isValid(schema, data), does three things:

  • Dereference the schema to resolve all external references
  • Validate the resulting fullSchema
  • Validate the data against the fullSchema.

Usage

API

/**
 * Provides a convenience interface to validate a data object
 * against a dereferenced schema object.
 *
 * Throws a SchemaError if either the schema or data is not valid.
 * SchemaError provides an `errors` property, detailing individual
 * violations.
 *
 * @async
 * @param schema schema to validate data against
 * @param data data to validate
 * @returns Promise<boolean>
 */
export declare const isValid: (schema: any, data?: any) => Promise<boolean>;

CLI

  Usage: data-check [options]


  Options:

    -V, --version          output the version number
    -d, --data <data>      data to validate {json, yaml}
    -s, --schema <schema>  schema to use for validation {json, yaml}
    -h, --help             output usage information

Development Tooling

License

Apache-2.0

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Support

Bugs, PRs, comments, suggestions welcomed!

Keywords

json

FAQs

Package last updated on 20 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts