{"id":34651550,"url":"https://github.com/tetherto/pear-apps-utils-validator","last_synced_at":"2026-01-20T18:09:16.339Z","repository":{"id":329971870,"uuid":"1113288139","full_name":"tetherto/pear-apps-utils-validator","owner":"tetherto","description":null,"archived":false,"fork":false,"pushed_at":"2025-12-22T15:07:41.000Z","size":91,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-24T02:32:57.054Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tetherto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-09T19:14:38.000Z","updated_at":"2025-12-22T15:07:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tetherto/pear-apps-utils-validator","commit_stats":null,"previous_names":["tetherto/pear-apps-utils-validator"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/tetherto/pear-apps-utils-validator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fpear-apps-utils-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fpear-apps-utils-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fpear-apps-utils-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fpear-apps-utils-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tetherto","download_url":"https://codeload.github.com/tetherto/pear-apps-utils-validator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fpear-apps-utils-validator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28608141,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T16:10:39.856Z","status":"ssl_error","status_checked_at":"2026-01-20T16:10:39.493Z","response_time":117,"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":[],"created_at":"2025-12-24T17:56:45.845Z","updated_at":"2026-01-20T18:09:16.334Z","avatar_url":"https://github.com/tetherto.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pear-apps-utils-validator\n\nA lightweight and flexible JavaScript library for validating. It provides a simple API to define validation rules for various data types, including strings, numbers, arrays, and objects.\n\n## Table of Contents\n\n- [Table of Contents](#table-of-contents)\n- [Features](#features)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n- [Dependencies](#dependencies)\n- [Related Projects](#related-projects)\n\n## Features\n\n- Validate strings, numbers, arrays, and objects.\n- Built-in validation rules like `required`, `minLength`, `maxLength`, `min`, `max`, `email`, and more.\n- Custom validation with `refine`.\n- Schema-based validation for objects and arrays.\n- Lightweight and easy to use.\n\n## Installation\n\nInstall the library using npm:\n```bash\nnpm install pear-apps-utils-validator\n```\n\n## Usage Examples\n\n### String Validation\n```js\nimport { Validator } from 'pear-apps-utils-validator';\n\nconst validator = Validator.string().required().minLength(3);\nconsole.log(validator.validate('')); // Output: \"This field is required\"\nconsole.log(validator.validate('ab')); // Output: \"Minimum length is 3\"\nconsole.log(validator.validate('abc')); // Output: null\n```\n\n### Object Validation\n```js\nconst schema = {\n    name: Validator.string().required(),\n    age: Validator.number().min(18),\n};\n\nconst validator = Validator.object(schema);\nconsole.log(validator.validate({ name: '', age: 16 })); \n// Output: { name: \"This field is required\", age: \"Minimum value is 18\" }\n```\n\n### Array Validation\n```js\nconst itemValidator = Validator.string().minLength(3);\nconst arrayValidator = Validator.array().items(itemValidator);\n\nconsole.log(arrayValidator.validate(['valid', 'a'])); \n// Output: [{ index: 1, error: \"Minimum length is 3\" }]\n```\n\n## Dependencies\n\nThis package has no production dependencies.\n\n## Related Projects\n\n- [pearpass-app-mobile](https://github.com/tetherto/pearpass-app-mobile) - A mobile app for PearPass, a password manager\n- [pearpass-app-desktop](https://github.com/tetherto/pearpass-app-desktop) - A desktop app for PearPass, a password manager\n- [pearpass-lib-vault](https://github.com/tetherto/pearpass-lib-vault) - A library for managing password vaults\n- [tether-dev-docs](https://github.com/tetherto/tether-dev-docs) - Documentations and guides for developers\n\n## License\n\nThis project is licensed under the Apache License, Version 2.0. See the [LICENSE](./LICENSE) file for details.k","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetherto%2Fpear-apps-utils-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftetherto%2Fpear-apps-utils-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetherto%2Fpear-apps-utils-validator/lists"}