{"id":18717427,"url":"https://github.com/js-data/js-data-schema","last_synced_at":"2025-04-12T13:32:25.012Z","repository":{"id":20786098,"uuid":"24071163","full_name":"js-data/js-data-schema","owner":"js-data","description":"Define and validate rules, datatypes and schemata in Node and in the browser.","archived":false,"fork":false,"pushed_at":"2015-06-03T17:22:51.000Z","size":735,"stargazers_count":18,"open_issues_count":5,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T17:54:10.542Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.js-data.io/docs/js-data-schema","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/js-data.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-15T19:47:13.000Z","updated_at":"2021-12-16T04:38:34.000Z","dependencies_parsed_at":"2022-08-05T09:15:36.276Z","dependency_job_id":null,"html_url":"https://github.com/js-data/js-data-schema","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-data%2Fjs-data-schema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-data%2Fjs-data-schema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-data%2Fjs-data-schema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-data%2Fjs-data-schema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/js-data","download_url":"https://codeload.github.com/js-data/js-data-schema/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248573518,"owners_count":21126849,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T13:16:12.664Z","updated_at":"2025-04-12T13:32:24.763Z","avatar_url":"https://github.com/js-data.png","language":"JavaScript","readme":"\u003cimg src=\"https://raw.githubusercontent.com/js-data/js-data/master/js-data.png\" alt=\"js-data logo\" title=\"js-data\" align=\"right\" width=\"64\" height=\"64\" /\u003e\n\n## js-data-schema [![bower version](https://img.shields.io/bower/v/js-data-schema.svg?style=flat-square)](https://www.npmjs.org/package/js-data-schema) [![npm version](https://img.shields.io/npm/v/js-data-schema.svg?style=flat-square)](https://www.npmjs.org/package/js-data-schema) [![Circle CI](https://img.shields.io/circleci/project/js-data/js-data-schema/master.svg?style=flat-square)](https://circleci.com/gh/js-data/js-data-schema/tree/master) [![npm downloads](https://img.shields.io/npm/dm/js-data-schema.svg?style=flat-square)](https://www.npmjs.org/package/js-data-schema) [![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/js-data/js-data-schema/blob/master/LICENSE)\n\n__Define and validate rules, datatypes and schemata in Node and in the browser.__\n\n### API Documentation\n[Schemator API](http://www.js-data.io/docs/js-data-schema)\n\n### Install\n\n##### Node\n`npm install --save js-data-schema`\n\n```js\nvar Schemator = require('js-data-schema');\n```\n\n##### Browser\n`npm install --save js-data-schema` or `bower install --save js-data-schema`\n\nLoad `js-data-schema/dist/js-data-schema.js` into your browser.\n\n```js\n// global constructor if you're not using AMD or CommonJS\nwindow.Schemator;\n\n// AMD\ndefine(['js-data-schema'], function (Schemator) { ... })\n\n// CommonJS\nvar Schemator = require('js-data-schema');\n```\n\n### Getting Started\n\n```js\nvar schemator = new Schemator();\n\nschemator.defineSchema('Person', {\n  name: 'string'\n});\n\nvar errors = schemator.validateSync('Person', { name: 'John' });\n\nerrors; // null\n\nerrors = schemator.validateSync('Person', { name: 50043 });\n\nerrors; // {\n        //   name: [{\n        //     rule: 'type',\n        //     actual: 'number',\n        //     expected: 'string'\n        //   }]\n        // }\n```\n\n### Project Status\n\n__Latest Release:__ [![Latest Release](https://img.shields.io/github/release/js-data/js-data-schema.svg?style=flat-square)](https://github.com/js-data/js-data-schema/releases)\n\n__Status:__\n\n[![Dependency Status](https://img.shields.io/gemnasium/js-data/js-data-schema.svg?style=flat-square)](https://gemnasium.com/js-data/js-data-schema) [![Coverage Status](https://img.shields.io/coveralls/js-data/js-data-schema/master.svg?style=flat-square)](https://coveralls.io/r/js-data/js-data-schema?branch=master) [![Codacity](https://img.shields.io/codacy/e35036d4d2ea4c618a5711f3dd4ba659.svg?style=flat-square)](https://www.codacy.com/public/jasondobry/js-data-schema/dashboard)\n\n__Supported Platforms:__\n\n[![browsers](https://img.shields.io/badge/Browser-Chrome%2CFirefox%2CSafari%2COpera%2CIE%209%2B%2CiOS%20Safari%207.1%2B%2CAndroid%20Browser%202.3%2B-green.svg?style=flat-square)](https://github.com/js-data/js-data)\n\n### API\n\n[js-data-schema api](http://www.js-data.io/docs/js-data-schema)\n\n### Contributing\n\nFirst, support is handled via the [Mailing List](https://groups.io/org/groupsio/jsdata). Ask your questions there.\n\nWhen submitting issues on GitHub, please include as much detail as possible to make debugging quick and easy.\n\n- good - Your versions of js-data, js-data-schema, etc, relevant console logs/error, code examples that revealed the issue\n- better - A [plnkr](http://plnkr.co/), [fiddle](http://jsfiddle.net/), or [bin](http://jsbin.com/?html,output) that demonstrates the issue\n- best - A Pull Request that fixes the issue, including test coverage for the issue and the fix\n\n[Github Issues](https://github.com/js-data/js-data-schema/issues).\n\n#### Pull Requests\n\n1. Contribute to the issue that is the reason you'll be developing in the first place\n1. Fork js-data-schema\n1. `git clone https://github.com/\u003cyou\u003e/js-data-schema.git`\n1. `cd js-data-schema; npm install; bower install;`\n1. `grunt go` (builds and starts a watch)\n1. (in another terminal) `grunt karma:dev` (runs the tests)\n1. Write your code, including relevant documentation and tests\n1. Submit a PR and we'll review\n\n### License\n[MIT License](https://github.com/js-data/js-data-schema/blob/master/LICENSE)\n\nCopyright © 2013-2015 Jason Dobry\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjs-data%2Fjs-data-schema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjs-data%2Fjs-data-schema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjs-data%2Fjs-data-schema/lists"}