{"id":15690562,"url":"https://github.com/ardalanamini/verifications","last_synced_at":"2025-05-07T23:44:34.728Z","repository":{"id":57391668,"uuid":"113336515","full_name":"ardalanamini/verifications","owner":"ardalanamini","description":"universal verification library for developers","archived":false,"fork":false,"pushed_at":"2018-01-11T14:45:45.000Z","size":2462,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T23:44:31.940Z","etag":null,"topics":["credit-card","identification","national-code","social-security-number","ssn","verification"],"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/ardalanamini.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-06T15:54:41.000Z","updated_at":"2023-10-05T14:50:27.000Z","dependencies_parsed_at":"2022-09-19T06:10:53.051Z","dependency_job_id":null,"html_url":"https://github.com/ardalanamini/verifications","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ardalanamini%2Fverifications","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ardalanamini%2Fverifications/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ardalanamini%2Fverifications/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ardalanamini%2Fverifications/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ardalanamini","download_url":"https://codeload.github.com/ardalanamini/verifications/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252973617,"owners_count":21834105,"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":["credit-card","identification","national-code","social-security-number","ssn","verification"],"created_at":"2024-10-03T18:11:49.820Z","updated_at":"2025-05-07T23:44:34.704Z","avatar_url":"https://github.com/ardalanamini.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Verifications\n\nA **TypeScript Ready** universal verification library (Server-Side and Client-Side) for developers.\n\n[![npm](https://img.shields.io/npm/v/verifications.svg)](https://www.npmjs.com/package/verifications)\n[![npm](https://img.shields.io/npm/dm/verifications.svg)](https://www.npmjs.com/package/verifications)\n[![GitHub stars](https://img.shields.io/github/stars/ardalanamini/verifications.svg)](https://github.com/ardalanamini/verifications/stargazers)\n[![license](https://img.shields.io/github/license/ardalanamini/verifications.svg)](https://github.com/ardalanamini/verifications/blob/master/LICENSE)\n\n[TOC]\n\n## Installation\n\n`npm i -s verifications`\n\n## Usage\n\n### require / import\n\n```javascript\n// Node.js :\nconst Verifications = require('verifications');\n// ES6 :\nimport Verifications from 'verifications';\n// Typescript :\nimport * as Verifications from 'verifications';\n```\n\n### Available Methods\n\n- NationalID\n  - verify(code: string, locale?: string): boolean\n- CreditCard\n  - verify(code: string): boolean\n  - type(code: string): string | undefined\n  - issuer(code: string): { name: string, alias: string, website: string } | undefined\n  - identify(code: string): { type: Type, issuer: Issuer } | undefined\n- Phone\n  - identify(number: string): identity: { [key: string]: any } | undefined\n  - country(number: string): { name: string, alias: string } | undefined\n  - fancy(number: string): string\n  - normalize(number: string): string\n\n#### NationalID\n\n##### Verify\n\n```javascript\nVerifications\n\t.NationalID\n\t.verify('xxx-xxxxxx-x');\n// returns true if the code matches any supported format\n```\n\nyou can also enforce the locale\n\n```javascript\nVerifications\n\t.NationalID\n\t.verify('xxx-xx-xxxx', 'US');\n```\n\n**Supported Locales:**\n\n- Iran (IR) - کد ملی\n- United States (US) - Social Security Number (SSN)\n- United Kingdom (UK) - National Insurance Number (NINO)\n\n#### CreditCard\n\n\n##### Verify\n\n```javascript\nVerifications\n\t.CreditCard\n\t.verify('xxxx-xxxx-xxxx-xxxx');\n// returns true if the code matches any supported format\n```\n\n##### Identify\n\n```javascript\nVerifications\n\t.CreditCard\n\t.identify('xxxx-xxxx-xxxx-xxxx');\n// returns identity of the card/issuer\n```\n\n##### Type\n\n```javascript\nVerifications\n\t.CreditCard\n\t.type('xxxx-xxxx-xxxx-xxxx');\n// returns type of the card\n```\n\n##### Issuer\n\n```javascript\nVerifications\n\t.CreditCard\n\t.issuer('xxxx-xxxx-xxxx-xxxx');\n// returns issuer of the card\n```\n\n**Luhn verification algorithm (almost all credit cards around the globe)**\n\n- 9 card/issuer types\n- 46 active issuers are supported\n\n#### Phone\n\n##### Identify\n\n```javascript\nVerifications\n\t.Phone\n\t.identify('+xx (xxx) xxx xxxx');\n// returns the identity of the number or undefined\n```\n\n##### Country\n\n```javascript\nVerifications\n\t.Phone\n\t.country('+xx (xxx) xxx xxxx');\n// returns the country of the number or undefined\n```\n\n##### Fancy\n\n```javascript\nVerifications\n\t.Phone\n\t.fancy('00xx xx x xxx x x xx');\n// returns the beautified format if supported or the given number\n```\n\n##### Normalize\n\n```javascript\nVerifications\n\t.Phone\n\t.normalize('+xx (xxx) xxx xxxx');\n// returns numbers only -\u003e xxxxxxxxxxxx\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fardalanamini%2Fverifications","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fardalanamini%2Fverifications","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fardalanamini%2Fverifications/lists"}