Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    node-document-validator-jsonschemapublic

    NODE-DOCUMENT-VALIDATOR-JSONSCHEMA Build Status

    Validator adapter json-schema for node-document ODM for Node.js.

    Installation

      $ npm install node-document-validator-jsonschema

    Usage

    Basic:

      var Validator = require('node-document-validator-jsonschema');
     
      var validator = new Validator();
     
      var data = {
        foo: "foo",
        bar: 123,
        baz: undefined
      };
     
      var schema = {
        foo: {
          type: "string",
          minLength: 4
        },
        bar: {
          type: "number"
        },
        baz: {
          required: true
        }
      };
     
      validator.validate(data, schema, function(err, errors, valid) {
        console.log("Valid: %s  \nErrors:\n", valid, errors);
      });

    For details; see node-document.

    Test

    Local tests:

      $ make test

    License

    Released under the MIT license.

    Copyright (c) Jonas Grimfelt

    Keywords

    none

    install

    npm i node-document-validator-jsonschema

    Downloadslast 7 days

    0

    version

    0.1.0

    license

    none

    repository

    github.com

    last publish

    collaborators

    • avatar