{"id":18352360,"url":"https://github.com/plughacker/card-validator","last_synced_at":"2025-08-12T12:35:06.284Z","repository":{"id":207774431,"uuid":"720010022","full_name":"plughacker/card-validator","owner":"plughacker","description":"A simple card validator","archived":false,"fork":false,"pushed_at":"2024-08-16T20:15:15.000Z","size":128,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T10:12:08.754Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/plughacker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-17T11:36:42.000Z","updated_at":"2024-08-16T20:14:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"13699045-c260-484c-afb5-b08a5e44e4e5","html_url":"https://github.com/plughacker/card-validator","commit_stats":null,"previous_names":["plughacker/card-validator"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plughacker%2Fcard-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plughacker%2Fcard-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plughacker%2Fcard-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plughacker%2Fcard-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plughacker","download_url":"https://codeload.github.com/plughacker/card-validator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252705374,"owners_count":21791254,"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-05T21:35:44.048Z","updated_at":"2025-08-12T12:35:06.275Z","avatar_url":"https://github.com/plughacker.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"docs/assets/card.png\" width=\"130\" /\u003e\n  \u003ch1\u003eCard Validator\u003c/h1\u003e\n\u003c/div\u003e\n\n![CI](https://github.com/plughacker/card-validator/actions/workflows/release.yml/badge.svg)\n\nA simple card validator based on the Braintree validator\n\n## Getting Started\n\n1. Install the `card-validator` 💳\n\n```bash\nyarn add @malga/card-validator\n# or\nnpm install @malga/card-validator\n# or\npnpm add @malga/card-validator\n```\n\n2. Now just validate your cards\n\n```ts\nimport { valid } from '@malga/card-validator'\n\nvalid.number('6274160007029307')\n/*\n{\n  card: {\n    niceType: 'VR',\n    type: 'vr',\n    patterns: [ 627416, 637036 ],\n    gaps: [],\n    lengths: [ 16 ],\n    code: { name: 'CVV', size: 3 },\n    matchStrength: 6\n  },\n  isPotentiallyValid: true,\n  isValid: true\n}\n*/\n```\n\n3. Mask a card number\n\n```ts\nimport { maskCardNumber } from '@malga/card-validator'\n\nmaskCardNumber('0000000000000000')\n// 0000 0000 0000 0000\n```\n\n## Contributing\n\nFeel free to contribute to this project by submitting pull requests, creating documentation, or bringing ideas to make the project even better!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplughacker%2Fcard-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplughacker%2Fcard-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplughacker%2Fcard-validator/lists"}