{"id":19985900,"url":"https://github.com/aeberdinelli/schemy","last_synced_at":"2025-05-04T07:30:53.835Z","repository":{"id":47980321,"uuid":"275697670","full_name":"aeberdinelli/schemy","owner":"aeberdinelli","description":"Schemy is an extremely simple, lightweight schema validation library.","archived":false,"fork":false,"pushed_at":"2024-02-13T22:01:07.000Z","size":340,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-28T22:21:54.680Z","etag":null,"topics":["javascript","joi","json","library","mongoose","node","nodejs","schema","typescript","validation"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/schemy","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aeberdinelli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=aeberdinelli%40gmail.com\u0026item_name=Schemy+library\u0026currency_code=USD\u0026source=url"]}},"created_at":"2020-06-29T01:03:30.000Z","updated_at":"2023-12-30T11:48:26.000Z","dependencies_parsed_at":"2024-02-13T22:52:35.650Z","dependency_job_id":null,"html_url":"https://github.com/aeberdinelli/schemy","commit_stats":{"total_commits":116,"total_committers":5,"mean_commits":23.2,"dds":0.4913793103448276,"last_synced_commit":"db9194224eb5085489809145f83596df82477c0b"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeberdinelli%2Fschemy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeberdinelli%2Fschemy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeberdinelli%2Fschemy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeberdinelli%2Fschemy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aeberdinelli","download_url":"https://codeload.github.com/aeberdinelli/schemy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224388448,"owners_count":17303080,"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":["javascript","joi","json","library","mongoose","node","nodejs","schema","typescript","validation"],"created_at":"2024-11-13T04:26:45.239Z","updated_at":"2024-11-13T04:26:45.816Z","avatar_url":"https://github.com/aeberdinelli.png","language":"JavaScript","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=aeberdinelli%40gmail.com\u0026item_name=Schemy+library\u0026currency_code=USD\u0026source=url","https://www.paypal.com/donate/?cmd=_donations\u0026business=aeberdinelli%40gmail.com\u0026item_name=Schemy+library\u0026currency_code=USD\u0026source=url"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\r\n    \u003ca href=\"https://schemy.js.org/\"\u003e\r\n        \u003cimg src=\"https://user-images.githubusercontent.com/1413883/134991554-4ff6464e-c297-4367-8191-088f9919a5e1.png\" height=\"110\"\u003e\r\n    \u003c/a\u003e\r\n\u003c/div\u003e\r\n\r\n### [Docs 📖](https://github.com/aeberdinelli/schemy/wiki) · [Plugins 🧩](https://github.com/aeberdinelli/schemy/wiki/List-of-plugins) · [Changelog 📝](https://github.com/aeberdinelli/schemy/releases) · [Donate 💰](https://www.paypal.com/donate/?cmd=_donations\u0026business=aeberdinelli%40gmail.com\u0026item_name=Schemy+library\u0026currency_code=USD\u0026source=url)\r\n\r\nSchemy is an extremely simple, lightweight yet powerful schema validation library. Perfect for lightweight-oriented projects like cloud functions where size and speed are key features. **It weights less than 18 KB!**\r\n\r\n## Usage\r\nInstall using npm: `npm install --save schemy`.\r\nThen, create a schema with the desired properties and their types:\r\n\r\n```javascript\r\nconst Schemy = require('schemy');\r\n\r\nconst characterSchema = new Schemy({\r\n    'name': {\r\n        type: String,\r\n        required: true\r\n    }\r\n});\r\n\r\n// Validate against input data\r\nif (!characterSchema.validate(someData)) {\r\n    characterSchema.getValidationErrors(); // =\u003e [ 'Missing required property name' ]\r\n}\r\n\r\n// You can also validate asynchronously\r\nawait Schemy.validate(someData, characterSchema);\r\n```\r\n\r\n## Plugins\r\nSchemy can be easily extended with new functionality. For example, this adds a feature to reference properties within the schema.\r\n\r\n```javascript\r\n// Require the plugin\r\nconst ReferenceSupport = require('schemy-reference-support');\r\n\r\n// Call Schemy.extend() with the plugin or with an array of plugins\r\nSchemy.extend(ReferenceSupport);\r\n\r\nnew Schemy({\r\n    password: String,\r\n    confirm: Schemy.$ref('password')\r\n});\r\n```\r\n\r\nYou can check the whole list of [available plugins in the wiki ↗](https://github.com/aeberdinelli/schemy/wiki/List-of-plugins) \r\n\r\n## API\r\n#### Static methods\r\n- [Schemy(object)](https://github.com/aeberdinelli/schemy/wiki#-usage) - Takes an object with the desired structure to validate later\r\n- [Schemy.validate(data, schema)](https://github.com/aeberdinelli/schemy/wiki/Async-validation#async-validation) - Asynchronously validates some data against the passed schema\r\n- [Schemy.extend(Plugin)](https://github.com/aeberdinelli/schemy/wiki/Using-plugins) - Load one or multiple plugins into Schemy\r\n\r\n#### Instance methods\r\n- [validate(data)](https://github.com/aeberdinelli/schemy/wiki/Synchronous-validation) - Validates the schema\r\n- [getValidationErrors()](https://github.com/aeberdinelli/schemy/wiki/getValidationErrors) - Returns generated errors from the last validation\r\n- [getBody(includeAll = false)](https://github.com/aeberdinelli/schemy/wiki/getBody(includeAll-=-false)) - Returns the last validated input\r\n\r\n\u003cbr\u003e\r\n\r\n[Full documentation ↗️](https://github.com/aeberdinelli/schemy/wiki)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faeberdinelli%2Fschemy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faeberdinelli%2Fschemy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faeberdinelli%2Fschemy/lists"}