json-schema-model
v1.0.4
Published
Parser and compiler for JS models by JSON schema.
Downloads
9
Maintainers
Readme
JSON Schema Model
Parser and compiler for JS models by JSON schema.
Installation
bower i json-schema-model --save
# or
npm i json-schema-model --save
Usage
function User (obj) {
JsonSchemaModel.call(this, {
firstName: 'first_name',
lastName: 'last_name',
middleName: 'middle_name'
});
this.fromSchema(obj);
}
Methods
fromSchema
- parse data by the schema object.
toSchema
- convert data to the schema object.
Properties
schema
- schema object
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
History
2.06.16 Initial config
Credits
Author: Alexey Bondarenko bondalex.com
License
MIT