readme.md 976 Bytes
Newer Older
Jaap Karan Singh's avatar
Jaap Karan Singh committed
1 2 3 4 5 6
JSON Schema Validator
=====================

jsonschema validator with custom types and attributes


7 8 9
Usage
-----

Jaap Karan Singh's avatar
Jaap Karan Singh committed
10 11
### Installation

12
Install the module as a git npm module. For example, to install `v0.1.0` add the following to `package.json`. **Note:** It is important to use `js_jsonschema-validator` as the dependency name.
Jaap Karan Singh's avatar
Jaap Karan Singh committed
13 14 15 16

```json
{
	"dependencies": {
17
		"js_jsonschema-validator": "git+ssh://git@gitlab.com:jksdua__common/jsonschema-validator.git#v0.1.0"
Jaap Karan Singh's avatar
Jaap Karan Singh committed
18 19 20 21
	}
}
```

22
```js
Jaap Karan Singh's avatar
Jaap Karan Singh committed
23
var validator = require('js_jsonschema-validator').validator;
24 25 26 27 28 29 30 31 32 33 34 35

// regexp
validator.validate(/abc/, { type: 'regexp' });

// error
validator.validate(new Error(), { type: 'error' });

// objectid
validator.validate('123456789012345678901234', { type: 'objectId' });
```


Jaap Karan Singh's avatar
Jaap Karan Singh committed
36 37 38
Changelog
---------

Jaap Karan Singh's avatar
Jaap Karan Singh committed
39
### v0.1.0 (24 June 2014)
Jaap Karan Singh's avatar
Jaap Karan Singh committed
40 41
- Changed namespace to `js` from `ht`

Jaap Karan Singh's avatar
Jaap Karan Singh committed
42
### v0.0.2 (24 June 2014)
43 44 45 46
- Removed dependency on `mongoskin`
- Added some tests
- Removed shrinkwrap

Jaap Karan Singh's avatar
Jaap Karan Singh committed
47
### v0.0.1 (24 June 2014)
Jaap Karan Singh's avatar
Jaap Karan Singh committed
48
- Initial commit