{"id":25627441,"url":"https://github.com/codex-central/check-format-password","last_synced_at":"2026-06-12T23:32:16.096Z","repository":{"id":215163873,"uuid":"738249956","full_name":"Codex-Central/check-format-password","owner":"Codex-Central","description":"Allow checking password format","archived":false,"fork":false,"pushed_at":"2024-01-02T22:27:35.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T23:05:38.883Z","etag":null,"topics":["javascript","password","security","typescript","validation"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@codexcentral/check-format-password","language":"TypeScript","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/Codex-Central.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2024-01-02T19:39:11.000Z","updated_at":"2024-04-24T00:27:13.000Z","dependencies_parsed_at":"2024-01-26T13:09:02.116Z","dependency_job_id":"6a581831-49af-490d-b00d-772904ca817b","html_url":"https://github.com/Codex-Central/check-format-password","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"a6f20c17da435af518b81413d74873a42e3052fb"},"previous_names":["codex-central/check-format-password"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codex-Central%2Fcheck-format-password","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codex-Central%2Fcheck-format-password/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codex-Central%2Fcheck-format-password/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codex-Central%2Fcheck-format-password/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Codex-Central","download_url":"https://codeload.github.com/Codex-Central/check-format-password/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240214600,"owners_count":19766262,"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","password","security","typescript","validation"],"created_at":"2025-02-22T17:49:07.286Z","updated_at":"2025-11-12T23:02:47.767Z","avatar_url":"https://github.com/Codex-Central.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# check-format-password\n\nAllow checking password format\n\n## Installation\n\n\u003e `npm install @codexcentral/check-format-password`\n\n## Usage\n\n### 1. Import the function\n\n```javascript\nimport {\n  checkFormatPassword,\n  TConfig,\n} from \"@codexcentral/check-format-password\";\n```\n\n### 2. Call the function\n\n#### Example 1\n\n```typescript\nconst config: TConfig = {\n  length: {\n    min: {\n      value: 2,\n      message: \"Password is too short.\",\n    },\n    max: {\n      value: 20,\n      message: \"Password is too long.\",\n    },\n  }\n};\nconst password = \"Password123@\";\nconst result = checkFormatPassword(password, config);\n\nconsole.log(result);\n// {\n//   isValid: true,\n//   message: \"Password is valid.\"\n// }\n```\n\n#### Example 2\n\n```typescript\nconst config = {\n  number: {\n    allow: true,\n    message: \"Password must contain at least one number.\",\n  },\n};\nconst passwordCheck = \"Password@\";\nconst result = checkFormatPassword(passwordCheck, config);\n\nconsole.log(result);\n/*\n {\n  isValid: false,\n  message: [\n       'Password must contain at least one number.',\n       'Password must contain at least one special character.'\n     ]\n }\n*/\n```\n\n## Attributes of \"TConfig\"\n  \n| Attribute | Type | Required | Default |\n| --- | --- | --- | --- |\n| length | object | false | { min: { value: 8, message: \"Password is too short.\" }, max: { value: 20, message: \"Password is too long.\" } } |\n| length.min | object | false | { value: 8, message: \"Password is too short.\" } |\n| length.min.value | number | false | 8 |\n| length.min.message | string | false | \"Password is too short.\" |\n| length.max | object | false | { value: 64, message: \"Password is too long.\" } |\n| length.max.value | number | false | 64 |\n| length.max.message | string | false | \"Password is too long.\" |\n| string | object | false | { allow: true, message: \"Password must contain at least one letter.\" } |\n| string.allow | boolean | false | true |\n| string.message | string | false | \"Password must contain at least one letter.\" |\n| string.upperCase | object | false | { allow: true, message: \"Password must contain at least one uppercase letter.\" } |\n| string.upperCase.allow | boolean | false | true |\n| string.upperCase.message | string | false | \"Password must contain at least one uppercase letter.\" |\n| string.lowerCase | object | false | { allow: true, message: \"Password must contain at least one lowercase letter.\" } |\n| string.lowerCase.allow | boolean | false | true |\n| string.lowerCase.message | string | false | \"Password must contain at least one lowercase letter.\" |\n| number | object | false | { allow: true, message: \"Password must contain at least one number.\" } |\n| number.allow | boolean | false | true |\n| number.message | string | false | \"Password must contain at least one number.\" |\n| specialChar | object | false | { allow: true, message: \"Password must contain at least one special character.\" } |\n| specialChar.allow | boolean | false | true |\n| specialChar.message | string | false | \"Password must contain at least one special character.\" |\n\n \n\n# Credits\n\nThese code was written by [Roberto Silva Z.](https://www.linkedin.com/in/robertosilvazuniga/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodex-central%2Fcheck-format-password","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodex-central%2Fcheck-format-password","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodex-central%2Fcheck-format-password/lists"}