{"id":28762519,"url":"https://github.com/keift/yuppi","last_synced_at":"2026-02-05T01:21:51.827Z","repository":{"id":297944820,"uuid":"998370115","full_name":"keift/yuppi","owner":"keift","description":"Schemas that can be converted to Yup and JSON Schema.","archived":false,"fork":false,"pushed_at":"2026-01-31T17:22:13.000Z","size":921,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-01T05:18:37.325Z","etag":null,"topics":["json-schema","openapi","typecheck","validate","validation","yup"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/yuppi","language":"TypeScript","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/keift.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-08T13:20:28.000Z","updated_at":"2026-01-31T17:22:16.000Z","dependencies_parsed_at":"2025-09-21T01:07:55.093Z","dependency_job_id":"e0d8f074-7759-44ab-973d-02ce2d397cf9","html_url":"https://github.com/keift/yuppi","commit_stats":null,"previous_names":["keift/yuppi"],"tags_count":44,"template":false,"template_full_name":null,"purl":"pkg:github/keift/yuppi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keift%2Fyuppi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keift%2Fyuppi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keift%2Fyuppi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keift%2Fyuppi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keift","download_url":"https://codeload.github.com/keift/yuppi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keift%2Fyuppi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29105274,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T00:52:08.035Z","status":"ssl_error","status_checked_at":"2026-02-05T00:52:07.703Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["json-schema","openapi","typecheck","validate","validation","yup"],"created_at":"2025-06-17T08:08:43.473Z","updated_at":"2026-02-05T01:21:51.818Z","avatar_url":"https://github.com/keift.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[String]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\n[Number]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number\n[Boolean]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean\n[Date]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date\n[Buffer]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\n[Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise\n[Void]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined\n[Null]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null\n[Undefined]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined\n\n\u003c!----\u003e\n\n[Domain]: ./src/patterns/Domain.pattern.ts\n[Email]: ./src/patterns/Email.pattern.ts\n[HTTP]: ./src/patterns/HTTP.pattern.ts\n[PhoneNumber]: ./src/patterns/PhoneNumber.pattern.ts\n[URI]: ./src/patterns/URI.pattern.ts\n[Username]: ./src/patterns/Username.pattern.ts\n\n\u003c!----\u003e\n\n[YuppiOptionsDefault]: ./src/defaults/YuppiOptions.default.ts\n\n\u003c!----\u003e\n\n[AnyObject]: ./src/types/AnyObject.type.ts\n[JSONSchema]: ./src/types/JSONSchema.type.ts\n[Schema]: ./src/types/Schema.type.ts\n[ValidationError]: ./src/types/ValidationError.type.ts\n[YuppiOptions]: ./src/types/YuppiOptions.type.ts\n[YupSchema]: ./src/types/YupSchema.type.ts\n\n\u003cdiv align=\"center\"\u003e\n  \u003cbr/\u003e\n  \u003cimg src=\"./assets/logo.png\" width=\"350px\"/\u003e\n  \u003cbr/\u003e\n  \u003cbr/\u003e\n  \u003cimg src=\"https://img.shields.io/npm/v/yuppi?label=version\u0026color=%23633BFF\"/\u003e\n  \u003cimg src=\"https://img.shields.io/npm/l/yuppi?label=license\u0026color=%23633BFF\"/\u003e\n  \u003cimg src=\"https://img.shields.io/npm/dt/yuppi?label=downloads\u0026color=%2300927F\"/\u003e\n  \u003cimg src=\"https://img.shields.io/npm/unpacked-size/yuppi?label=size\u0026color=%2300927F\"/\u003e\n\u003c/div\u003e\n\n## Contents\n\n- [About](#about)\n- [Features](#features)\n- [Installation](#installation)\n- [Documentation](#documentation)\n  - [Tree](#tree)\n  - [Import](#import)\n  - [Constructors](#constructors)\n  - [Methods](#methods)\n  - [Patterns](#patterns)\n  - [Types](#types)\n- [Links](#links)\n  - [Discord](https://discord.gg/keift)\n  - [Telegram](https://t.me/keiftco)\n  - [Twitter](https://x.com/keiftco)\n  - [GitHub](https://github.com/keift)\n- [License](#license)\n\n## About\n\nPortable and simple schemas for property validation.\n\n## Features\n\n- Easy and understandable schemas\n- Contains ready regex patterns\n- Portable schemas as a JSON file\n- Schemas can be declared for TypeScript\n- Schemas can be converted to [JSON Schema](https://json-schema.org). JSON Schema is OpenAPI compatible\n- Error messages are ready to be understood but can be edited if desired\n- Works with [Yup](https://npmjs.com/package/yup), stable and secure\n\n## Installation\n\nYou can install it as follows.\n\n```shell\n# NPM\nnpm add yuppi\n\n# PNPM\npnpm add yuppi\n\n# Yarn\nyarn add yuppi\n\n# Bun\nbun add yuppi\n\n# Deno\ndeno add yuppi\n```\n\n## Documentation\n\n### Tree\n\nBriefly as follows.\n\n```typescript\nyuppi\n│\n├── new Yuppi(options?)\n│   │\n│   ├── validate(schema, properties)\n│   ├── declare(schema, name)\n│   ├── convertToYup(schema)\n│   └── convertToJSONSchema(schema)\n│\n├── Patterns\n│   │\n│   ├── Domain\n│   ├── Email\n│   ├── HTTP\n│   ├── PhoneNumber\n│   ├── URI\n│   └── Username\n│\n├── type AnyObject\n├── type JSONSchema\n├── type Schema\n├── type ValidationError\n├── type YuppiOptions\n└── type YupSchema\n```\n\n### Import\n\nBriefly as follows.\n\n```typescript\nimport { Yuppi, Patterns } from 'yuppi';\n```\n\n### Constructors\n\n`new Yuppi(options?)`\n\nYuppi schema builder.\n\n\u003e | Parameter  | Type           | Default               | Description            |\n\u003e | ---------- | -------------- | --------------------- | ---------------------- |\n\u003e | `options?` | [YuppiOptions] | [YuppiOptionsDefault] | Constructor's options. |\n\u003e\n\u003e Example:\n\u003e\n\u003e ```typescript\n\u003e const Yupp = new Yuppi();\n\u003e ```\n\n### Methods\n\n`Yuppi.validate(schema, properties)`\n\nValidate the properties with your Yuppi schema.\n\n\u003e | Parameter    | Type        | Default | Description                |\n\u003e | ------------ | ----------- | ------- | -------------------------- |\n\u003e | `schema`     | [Schema]    |         | Yuppi schema.              |\n\u003e | `properties` | [AnyObject] |         | Properties to be validate. |\n\u003e\n\u003e returns [Promise]\u003c[AnyObject]\u003e\n\u003e\n\u003e Example:\n\u003e\n\u003e ```typescript\n\u003e const schema: Schema = {\n\u003e   display_name: {\n\u003e     type: 'string',\n\u003e     max: 32,\n\u003e     nullable: false,\n\u003e     required: true\n\u003e   },\n\u003e\n\u003e   username: {\n\u003e     type: 'string',\n\u003e     min: 3,\n\u003e     max: 16,\n\u003e     pattern: Patterns.Username,\n\u003e     nullable: false,\n\u003e     required: true\n\u003e   },\n\u003e\n\u003e   email: {\n\u003e     type: 'string',\n\u003e     pattern: Patterns.Email,\n\u003e     lowercase: true,\n\u003e     nullable: false,\n\u003e     required: true\n\u003e   },\n\u003e\n\u003e   permissions: [\n\u003e     {\n\u003e       type: 'string',\n\u003e       enum: ['*'],\n\u003e       nullable: false,\n\u003e       required: true\n\u003e     },\n\u003e     {\n\u003e       type: 'array',\n\u003e       items: {\n\u003e         type: 'string',\n\u003e         enum: ['read', 'write'],\n\u003e         nullable: false,\n\u003e         required: true\n\u003e       },\n\u003e       nullable: false,\n\u003e       required: true\n\u003e     }\n\u003e   ]\n\u003e };\n\u003e\n\u003e const properties = {\n\u003e   display_name: 'Fırat',\n\u003e   username: 'fir4tozden',\n\u003e   email: 'fir4tozden@gmail.com',\n\u003e   permissions: '*'\n\u003e };\n\u003e\n\u003e try {\n\u003e   await Yupp.validate(schema, properties);\n\u003e   /*\n\u003e     {\n\u003e       display_name: \"Fırat\",\n\u003e       username: \"fir4tozden\",\n\u003e       email: \"fir4tozden@gmail.com\",\n\u003e       permissions: \"*\"\n\u003e     }\n\u003e   */\n\u003e } catch (error) {\n\u003e   const errors = (error as ValidationError).errors;\n\u003e\n\u003e   console.log(errors[0]); // \"Field email must match the required pattern ^[a-zA-Z0-9._-]+@([a-zA-Z0-9-]+\\\\.)+[a-zA-Z]{2,}$\"\n\u003e }\n\u003e ```\n\n\u003cbr/\u003e\n\n`Yuppi.declare(schema, name)`\n\nDeclare your Yuppi schema for TypeScript.\n\n\u003e | Parameter | Type     | Default | Description       |\n\u003e | --------- | -------- | ------- | ----------------- |\n\u003e | `schema`  | [Schema] |         | Yuppi schema.     |\n\u003e | `name`    | [String] |         | Declaration name. |\n\u003e\n\u003e returns [Promise]\u003c[Void]\u003e\n\u003e\n\u003e Example:\n\u003e\n\u003e ```typescript\n\u003e import type { User } from './generated/yuppi/types/User';\n\u003e\n\u003e await Yupp.declare(schema, 'User');\n\u003e\n\u003e const user = (await Yupp.validate(schema, properties)) as User;\n\u003e /*\n\u003e   interface User {\n\u003e     display_name: string;\n\u003e     username: string;\n\u003e     email: string;\n\u003e     permissions: \"*\" | (\"read\" | \"write\")[];\n\u003e   }\n\u003e */\n\u003e ```\n\n\u003cbr/\u003e\n\n`Yuppi.convertToYup(schema)`\n\nConvert your Yuppi schema into Yup schema.\n\n\u003e | Parameter | Type     | Default | Description   |\n\u003e | --------- | -------- | ------- | ------------- |\n\u003e | `schema`  | [Schema] |         | Yuppi schema. |\n\u003e\n\u003e returns [YupSchema]\n\u003e\n\u003e Example:\n\u003e\n\u003e ```typescript\n\u003e Yupp.convertToYup(schema);\n\u003e ```\n\n\u003cbr/\u003e\n\n`Yuppi.convertToJSONSchema(schema)`\n\nConvert your Yuppi schema into [JSON Schema](https://json-schema.org).\n\n\u003e | Parameter | Type     | Default | Description   |\n\u003e | --------- | -------- | ------- | ------------- |\n\u003e | `schema`  | [Schema] |         | Yuppi schema. |\n\u003e\n\u003e returns [JSONSchema]\n\u003e\n\u003e Example:\n\u003e\n\u003e ```typescript\n\u003e Yupp.convertToJSONSchema(schema);\n\u003e /*\n\u003e   {\n\u003e     type: \"object\",\n\u003e     properties: {\n\u003e       display_name: {\n\u003e         type: \"string\",\n\u003e         maxLength: 32\n\u003e       },\n\u003e       username: {\n\u003e         type: \"string\",\n\u003e         minLength: 3,\n\u003e         maxLength: 16,\n\u003e         pattern: \"^(?=.*[a-zA-Z])[a-zA-Z0-9][a-zA-Z0-9_]*$\"\n\u003e       },\n\u003e       email: {\n\u003e         type: \"string\",\n\u003e         pattern: \"^[a-zA-Z0-9._-]+@([a-zA-Z0-9-]+\\\\.)+[a-zA-Z]{2,}$\"\n\u003e       },\n\u003e       permissions: {\n\u003e         anyOf: [\n\u003e           {\n\u003e             type: \"string\",\n\u003e             enum: [\"*\"]\n\u003e           },\n\u003e           {\n\u003e             type: \"array\",\n\u003e             items: {\n\u003e               type: \"string\",\n\u003e               enum: [\"read\", \"write\"]\n\u003e             }\n\u003e           }\n\u003e         ]\n\u003e       }\n\u003e     },\n\u003e     required: [\"display_name\", \"username\", \"email\", \"permissions\"],\n\u003e     additionalProperties: false\n\u003e   };\n\u003e */\n\u003e ```\n\n### Patterns\n\n| Pattern       | Description                    | Examples                                                                         |\n| ------------- | ------------------------------ | -------------------------------------------------------------------------------- |\n| [Domain]      | Domains.                       | `\"google.com\"` ✅\u003cbr/\u003e`\"www.google.com\"` ✅\u003cbr/\u003e`\"https://google.com\"` ❌        |\n| [Email]       | Emails.                        | `\"fir4tozden@gmail.com\"` ✅\u003cbr/\u003e`\"fir4tozden+2@gmail.com\"` ❌                    |\n| [HTTP]        | HTTP only links.               | `\"https://google.com\"` ✅\u003cbr/\u003e`\"http://google.com\"` ✅\u003cbr/\u003e`\"google.com\"` ❌     |\n| [PhoneNumber] | Country code and phone number. | `\"0090-555555555\"` ✅\u003cbr/\u003e`\"90-5555555555\"` ❌                                   |\n| [URI]         | Protocol free links.           | `\"mongodb://mongodb.net\"` ✅\u003cbr/\u003e`\"https://google.com\"` ✅\u003cbr/\u003e`\"google.com\"` ❌ |\n| [Username]    | Usernames like Twitter.        | `\"fir4tozden\"` ✅\u003cbr/\u003e`\"Fir4tozden\"` ✅\u003cbr/\u003e`\"fir4t ozden\"` ❌                   |\n\n### Types\n\n| Type              |\n| ----------------- |\n| [AnyObject]       |\n| [JSONSchema]      |\n| [Schema]          |\n| [ValidationError] |\n| [YuppiOptions]    |\n| [YupSchema]       |\n\n## Links\n\n- [Discord](https://discord.gg/keift)\n- [Telegram](https://t.me/keiftco)\n- [Twitter](https://x.com/keiftco)\n- [GitHub](https://github.com/keift)\n\n## License\n\nMIT License\n\nCopyright (c) 2025 Keift\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeift%2Fyuppi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeift%2Fyuppi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeift%2Fyuppi/lists"}