3.1.0 • Published 5 years ago
aschema v3.1.0
aschema
JSON schema validator
Installation
$ npm install aschema --save
Usage
'use strict'
const aschema = require('aschema')
// Define a schema object
const userSchema = aschema({
title: 'User',
description: 'A user',
type: 'object',
properties: {
id: {
description: 'The unique identifier for a account',
type: 'integer'
},
accountName: {
description: 'Name of the account',
type: 'string'
}
},
required: [
'id',
'name'
]
})
// Execute validation
let error = userSchema.validate({
name: 'foo'
})
if (error) {
console.error(error)
} else {
console.log('no error!')
}
License
This software is released under the MIT License.
Links
3.1.0
5 years ago
3.0.3
5 years ago
3.0.2
6 years ago
3.0.0
6 years ago
2.0.4
8 years ago
2.0.3
8 years ago
2.0.2
8 years ago
2.0.1
8 years ago
2.0.0
8 years ago
1.0.9
8 years ago
1.0.8
8 years ago
1.0.7
8 years ago
1.0.6
9 years ago
1.0.5
9 years ago
1.0.4
9 years ago
1.0.3
9 years ago
1.0.2
9 years ago
1.0.1
9 years ago
1.0.0
9 years ago