https://github.com/grimen/node-document-validator
Validator adapter interface for `node-document` ODM for Node.js.
https://github.com/grimen/node-document-validator
Last synced: 3 months ago
JSON representation
Validator adapter interface for `node-document` ODM for Node.js.
- Host: GitHub
- URL: https://github.com/grimen/node-document-validator
- Owner: grimen
- License: mit
- Created: 2013-01-04T22:35:50.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-11-29T13:38:04.000Z (over 11 years ago)
- Last Synced: 2025-02-12T17:53:28.791Z (3 months ago)
- Language: JavaScript
- Homepage: https://npmjs.org/package/node-document-validator
- Size: 137 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
# NODE-DOCUMENT-VALIDATOR [](http://travis-ci.org/grimen/node-document-validator)
**Validator** adapter interface for [node-document](https://github.com/grimen/node-document) ODM for Node.js.
## About
Unified interface for validating data based on a custom JSON Schema.
## Adapters
* [Amanda](https://github.com/grimen/node-document-validator-amanda)
* [Schema.js](https://github.com/grimen/node-document-validator-schema)
* [JSONGate](https://github.com/grimen/node-document-validator-jsongate)
* [JSONSchema](https://github.com/grimen/node-document-validator-jsonschema)
* [JSV](https://github.com/grimen/node-document-validator-jsv)## API
### `#validate`
* `(data, schema, [callback(err, res)])`
```javascript
validator.validate({foo: 'bar'}, {foo: {type: 'string', required: true}}, function(err, res) {
// console.log(arguments);
});
```## Installation
```shell
$ npm install node-document-validator
```## Usage
For details; see [node-document](https://github.com/grimen/node-document).
## Test
**Local tests:**
```shell
$ make test
```## License
Released under the MIT license.
Copyright (c) [Jonas Grimfelt](http://github.com/grimen)
[](https://bitdeli.com/free "Bitdeli Badge")