{"_id":"@bernierllc/phone-tools","_rev":"6-ea89347bc7cd7475de03759be3d4b53d","name":"@bernierllc/phone-tools","dist-tags":{"latest":"1.5.0"},"versions":{"1.0.0":{"name":"@bernierllc/phone-tools","version":"1.0.0","keywords":["phone","validation","formatting","phone-number","international","libphonenumber","e164","telephone","utilities"],"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","_id":"@bernierllc/phone-tools@1.0.0","maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"dist":{"shasum":"f95f52c6a93dbddfcc3836e453c09a2333e7b6d2","tarball":"https://registry.npmjs.org/@bernierllc/phone-tools/-/phone-tools-1.0.0.tgz","fileCount":28,"integrity":"sha512-xOP8R7MyxEvAHvn7fpMXNFIj43k/9KHBbP4dbQU9gYmQpWS9ywGNVjFP525d2uu/K+p3yPdcMBhx6Uybfobs4g==","signatures":[{"sig":"MEUCIQD2/oQ4qFTqf0lObelSD6VUj6gBXPOkscF1nOsc3bV5DAIgauePvX9YYJ5qtJxPCy8xGrNiN2lUP1v5CdbCVeqiqMM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":63404},"main":"dist/index.js","_from":"file:bernierllc-phone-tools-1.0.0.tgz","types":"dist/index.d.ts","scripts":{"lint":"eslint src --ext .ts,.tsx","test":"jest --watch","build":"tsc","clean":"rm -rf dist","test:run":"jest","test:coverage":"jest --coverage"},"_npmUser":{"name":"mkbernier","email":"mkbernier@gmail.com"},"_resolved":"/private/var/folders/r0/wspnzd1s18sfjy10ffyv2qxw0000gn/T/73af22ffb6c26288a53023346ca96ce8/bernierllc-phone-tools-1.0.0.tgz","_integrity":"sha512-xOP8R7MyxEvAHvn7fpMXNFIj43k/9KHBbP4dbQU9gYmQpWS9ywGNVjFP525d2uu/K+p3yPdcMBhx6Uybfobs4g==","_npmVersion":"11.6.2","description":"Comprehensive phone number manipulation and validation utilities for JavaScript/TypeScript applications","directories":{},"_nodeVersion":"25.1.0","dependencies":{"libphonenumber-js":"^1.11.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","eslint":"^8.0.0","ts-jest":"^29.0.0","typescript":"^5.0.0","@types/jest":"^29.0.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/phone-tools_1.0.0_1762379586322_0.9305009307188608","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@bernierllc/phone-tools","version":"1.2.0","keywords":["phone","validation","formatting","phone-number","international","libphonenumber","e164","telephone","utilities"],"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","_id":"@bernierllc/phone-tools@1.2.0","maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"dist":{"shasum":"fbb0870c711b24006d39ba479b34fec087c0ef70","tarball":"https://registry.npmjs.org/@bernierllc/phone-tools/-/phone-tools-1.2.0.tgz","fileCount":28,"integrity":"sha512-cabtKkgVR0yTeeAHfAQPOOGzVSBwecbS7vbATHi5NPgAWd3qpbvzn/Tt6mGCctIa7CW9/5JowH3pC6ejZ/9TlQ==","signatures":[{"sig":"MEQCIE6AOYjQUQpfAFMADSqujw1SoUgGFkgxkynahQ+tqTdAAiBKXNqHGK2hnU35mLNONJhrHyFnlt6FP3SAjF/rKUG+lg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":63558},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"af7e74b3715d56d3a193e1bb6743b337c2b0df6d","scripts":{"lint":"eslint src --ext .ts,.tsx","test":"jest --watch","build":"tsc","clean":"rm -rf dist","test:run":"jest","test:coverage":"jest --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:62240d58-3a65-405b-905d-5ff9fc002d2f"}},"_npmVersion":"lerna/9.0.3/node@v20.19.6+x64 (linux)","description":"Comprehensive phone number manipulation and validation utilities for JavaScript/TypeScript applications","directories":{},"_nodeVersion":"20.19.6","dependencies":{"libphonenumber-js":"^1.11.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","eslint":"^8.0.0","ts-jest":"^29.0.0","typescript":"^5.0.0","@types/jest":"^29.0.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/phone-tools_1.2.0_1767642319920_0.906177395968822","host":"s3://npm-registry-packages-npm-production"}},"1.2.1":{"name":"@bernierllc/phone-tools","version":"1.2.1","keywords":["phone","validation","formatting","phone-number","international","libphonenumber","e164","telephone","utilities"],"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","_id":"@bernierllc/phone-tools@1.2.1","maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"dist":{"shasum":"6c2cdba0b48eb114afd13d153ed2b1d523eacd58","tarball":"https://registry.npmjs.org/@bernierllc/phone-tools/-/phone-tools-1.2.1.tgz","fileCount":28,"integrity":"sha512-1zOjty9BsszIO3V/yhmhhrtG1N9FwdQEISNn1TL4OxNRSUHj2U4kpiHf3ktD5rCx9UnzV7H3Iullx9gb22QltQ==","signatures":[{"sig":"MEUCIQCKyc1av+MYjHrCbSjO11M1VJnZxaam36tknZmx3kY0swIgIjxZSkHwslq9xIqW4G1/No91mJGsnBFps7/X+JniRNs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":63500},"main":"dist/index.js","_from":"file:bernierllc-phone-tools-1.2.1.tgz","types":"dist/index.d.ts","scripts":{"lint":"eslint src --ext .ts,.tsx","test":"jest --watch","build":"tsc","clean":"rm -rf dist","test:run":"jest","test:coverage":"jest --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:62240d58-3a65-405b-905d-5ff9fc002d2f"}},"_resolved":"/tmp/968e414b8457b147cc51fe634102d376/bernierllc-phone-tools-1.2.1.tgz","_integrity":"sha512-1zOjty9BsszIO3V/yhmhhrtG1N9FwdQEISNn1TL4OxNRSUHj2U4kpiHf3ktD5rCx9UnzV7H3Iullx9gb22QltQ==","_npmVersion":"11.11.0","description":"Comprehensive phone number manipulation and validation utilities for JavaScript/TypeScript applications","directories":{},"_nodeVersion":"20.20.0","dependencies":{"libphonenumber-js":"^1.11.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","eslint":"^8.0.0","ts-jest":"^29.0.0","typescript":"^5.0.0","@types/jest":"^29.0.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/phone-tools_1.2.1_1773078045842_0.4278194922464622","host":"s3://npm-registry-packages-npm-production"}},"1.2.2":{"name":"@bernierllc/phone-tools","version":"1.2.2","keywords":["phone","validation","formatting","phone-number","international","libphonenumber","e164","telephone","utilities"],"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","_id":"@bernierllc/phone-tools@1.2.2","maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"dist":{"shasum":"bf258cdcf7fe945249f004e8049c546c2f0e2e46","tarball":"https://registry.npmjs.org/@bernierllc/phone-tools/-/phone-tools-1.2.2.tgz","fileCount":28,"integrity":"sha512-+a5oUeNbJ8llI09NV7a/fZWsRU5eGeDKtpSigDSrZwO7omljH4y+yWOCSYXL2I64UPD/acTmm4ilS4lmt9fzTw==","signatures":[{"sig":"MEUCIQD7iAM7rXkEtRTcJFuM0NE2a7+h/djZu737UhzednSLmgIgYM0VIncTExqgQRrZf9gQye0ciTwanPCWu4bK1DHf9AU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":63500},"main":"dist/index.js","_from":"file:bernierllc-phone-tools-1.2.2.tgz","types":"dist/index.d.ts","scripts":{"lint":"eslint src --ext .ts,.tsx","test":"jest --watch","build":"tsc","clean":"rm -rf dist","test:run":"jest","test:coverage":"jest --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:62240d58-3a65-405b-905d-5ff9fc002d2f"}},"_resolved":"/tmp/8efa79580f9ba6c0fe612b5ebfb7561e/bernierllc-phone-tools-1.2.2.tgz","_integrity":"sha512-+a5oUeNbJ8llI09NV7a/fZWsRU5eGeDKtpSigDSrZwO7omljH4y+yWOCSYXL2I64UPD/acTmm4ilS4lmt9fzTw==","_npmVersion":"11.11.0","description":"Comprehensive phone number manipulation and validation utilities for JavaScript/TypeScript applications","directories":{},"_nodeVersion":"20.20.0","dependencies":{"libphonenumber-js":"^1.11.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","eslint":"^8.0.0","ts-jest":"^29.0.0","typescript":"^5.0.0","@types/jest":"^29.0.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/phone-tools_1.2.2_1773081228017_0.7673307442421773","host":"s3://npm-registry-packages-npm-production"}},"1.4.0":{"name":"@bernierllc/phone-tools","version":"1.4.0","keywords":["phone","validation","formatting","phone-number","international","libphonenumber","e164","telephone","utilities"],"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","_id":"@bernierllc/phone-tools@1.4.0","maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"dist":{"shasum":"6c251209e1c26f4b6bcde13c5ec0bd3518121bad","tarball":"https://registry.npmjs.org/@bernierllc/phone-tools/-/phone-tools-1.4.0.tgz","fileCount":30,"integrity":"sha512-l7At266FnWvvsZLHyoWmj+9IjtQcialymMlbk4mCgTWF7P37QlkgQ10myYwVCQ5WckYR0CX1cXDqQeV8Q3/l7Q==","signatures":[{"sig":"MEQCIAoUzqLh1vFggtLJmhroQE1HbDGRaW5c7TazAK1b8CF7AiAQjir1Qz0YdLoXRCSt9edlfnm3P+eF6fIDiUKLdMCWRg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":64924},"main":"dist/index.js","_from":"file:bernierllc-phone-tools-1.4.0.tgz","types":"dist/index.d.ts","scripts":{"lint":"eslint src --ext .ts,.tsx","test":"jest --watch","build":"tsc","clean":"rm -rf dist","test:run":"jest","test:coverage":"jest --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:62240d58-3a65-405b-905d-5ff9fc002d2f"}},"_resolved":"/home/runner/work/tools/tools/packages/core/phone-tools/bernierllc-phone-tools-1.4.0.tgz","_integrity":"sha512-l7At266FnWvvsZLHyoWmj+9IjtQcialymMlbk4mCgTWF7P37QlkgQ10myYwVCQ5WckYR0CX1cXDqQeV8Q3/l7Q==","_npmVersion":"11.14.1","description":"Comprehensive phone number manipulation and validation utilities for JavaScript/TypeScript applications","directories":{},"_nodeVersion":"20.20.2","dependencies":{"libphonenumber-js":"^1.11.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","eslint":"^8.0.0","ts-jest":"^29.0.0","typescript":"^5.0.0","@types/jest":"^29.0.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/phone-tools_1.4.0_1779241328925_0.5085211525658713","host":"s3://npm-registry-packages-npm-production"}},"1.5.0":{"name":"@bernierllc/phone-tools","version":"1.5.0","description":"Comprehensive phone number manipulation and validation utilities for JavaScript/TypeScript applications","main":"dist/index.js","types":"dist/index.d.ts","keywords":["phone","validation","formatting","phone-number","international","libphonenumber","e164","telephone","utilities"],"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","dependencies":{"libphonenumber-js":"^1.11.0"},"devDependencies":{"@types/jest":"^29.0.0","@types/node":"^20.0.0","@typescript-eslint/eslint-plugin":"^6.0.0","@typescript-eslint/parser":"^6.0.0","eslint":"^8.0.0","jest":"^29.0.0","ts-jest":"^29.0.0","typescript":"^5.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"scripts":{"build":"tsc","test":"jest --watch","test:run":"jest","test:coverage":"jest --coverage","lint":"eslint src --ext .ts,.tsx","clean":"rm -rf dist"},"_id":"@bernierllc/phone-tools@1.5.0","_integrity":"sha512-VuFV/AruI7fwcBt/MO9EDjg1p54LhmQR1zQgRIHRGkmY8xZ51+W+8/E9JU3Ix1LgBuJzCtT9g5gGrs17XXnQnA==","_resolved":"/home/runner/work/tools/tools/packages/core/phone-tools/bernierllc-phone-tools-1.5.0.tgz","_from":"file:bernierllc-phone-tools-1.5.0.tgz","_nodeVersion":"20.20.2","_npmVersion":"11.14.1","dist":{"integrity":"sha512-VuFV/AruI7fwcBt/MO9EDjg1p54LhmQR1zQgRIHRGkmY8xZ51+W+8/E9JU3Ix1LgBuJzCtT9g5gGrs17XXnQnA==","shasum":"adc950c108d725438ee486655feb41a87893f773","tarball":"https://registry.npmjs.org/@bernierllc/phone-tools/-/phone-tools-1.5.0.tgz","fileCount":30,"unpackedSize":64924,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDLMlXNUJUUGltRsTHB9gtA6L/b/kO1lriY+WB6PwbPxAIhAK5FqNlMbTiWjNEuZr0oOWOyciTc67fEgUWIbXFcQlIi"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:62240d58-3a65-405b-905d-5ff9fc002d2f"}},"directories":{},"maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/phone-tools_1.5.0_1779250078382_0.6732779529206012"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-05T21:53:06.239Z","modified":"2026-05-20T04:07:58.671Z","1.0.0":"2025-11-05T21:53:06.538Z","1.2.0":"2026-01-05T19:45:20.074Z","1.2.1":"2026-03-09T17:40:45.992Z","1.2.2":"2026-03-09T18:33:48.149Z","1.4.0":"2026-05-20T01:42:09.059Z","1.5.0":"2026-05-20T04:07:58.522Z"},"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","keywords":["phone","validation","formatting","phone-number","international","libphonenumber","e164","telephone","utilities"],"description":"Comprehensive phone number manipulation and validation utilities for JavaScript/TypeScript applications","maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"readme":"# @bernierllc/phone-tools\n\nComprehensive phone number manipulation and validation utilities for JavaScript/TypeScript applications. Provides production-ready, locale-aware phone number processing including validation, formatting, parsing, type detection, and country code utilities.\n\n## Features\n\n- ✅ **International Validation** - Country-specific phone number validation\n- ✅ **Multiple Formats** - E.164, international, national, RFC3966\n- ✅ **Component Parsing** - Extract country code, area code, local number\n- ✅ **Type Detection** - Identify mobile, landline, toll-free, VoIP, etc.\n- ✅ **Privacy Masking** - Mask phone numbers for display\n- ✅ **Text Extraction** - Find phone numbers in text\n- ✅ **Link Generation** - Generate tel: and sms: links\n- ✅ **As-You-Type Formatting** - Progressive formatting for user input\n- ✅ **Batch Operations** - Process multiple numbers efficiently\n- ✅ **Country Utilities** - Calling codes, supported countries, examples\n\n## Installation\n\n```bash\nnpm install @bernierllc/phone-tools\n```\n\n## Quick Start\n\n```typescript\nimport {\n  validatePhoneNumber,\n  formatPhoneNumber,\n  parsePhoneNumber,\n  maskPhoneNumber\n} from '@bernierllc/phone-tools';\n\n// Validate\nconst result = validatePhoneNumber('+12133734253');\nconsole.log(result.isValid); // true\n\n// Format\nconst formatted = formatPhoneNumber('+12133734253', { format: 'NATIONAL' });\nconsole.log(formatted); // (213) 373-4253\n\n// Parse\nconst parsed = parsePhoneNumber('+12133734253');\nconsole.log(parsed.country); // US\n\n// Mask for privacy\nconst masked = maskPhoneNumber('+12133734253');\nconsole.log(masked); // +1 (***) ***-4253\n```\n\n## API Reference\n\n### Validation\n\n#### `validatePhoneNumber(phoneNumber, options?)`\n\nComprehensive phone number validation with detailed results.\n\n```typescript\nconst result = validatePhoneNumber('+12133734253');\n// {\n//   isValid: true,\n//   isPossible: true,\n//   country: 'US',\n//   type: 'FIXED_LINE',\n//   formatted: {\n//     e164: '+12133734253',\n//     international: '+1 213 373 4253',\n//     national: '(213) 373-4253'\n//   }\n// }\n```\n\n#### `isValidPhoneNumber(phoneNumber, options?)`\n\nSimple boolean validation.\n\n```typescript\nisValidPhoneNumber('+12133734253'); // true\nisValidPhoneNumber('123'); // false\n```\n\n#### `isPossiblePhoneNumber(phoneNumber, options?)`\n\nCheck if number has valid length for its country.\n\n```typescript\nisPossiblePhoneNumber('+12133734253'); // true\nisPossiblePhoneNumber('+1'); // false (too short)\n```\n\n### Formatting\n\n#### `formatPhoneNumber(phoneNumber, options?)`\n\nFormat phone number to different standards.\n\n```typescript\nformatPhoneNumber('+12133734253', { format: 'E164' });\n// '+12133734253'\n\nformatPhoneNumber('+12133734253', { format: 'INTERNATIONAL' });\n// '+1 213 373 4253'\n\nformatPhoneNumber('+12133734253', { format: 'NATIONAL' });\n// '(213) 373-4253'\n\nformatPhoneNumber('+12133734253', { format: 'RFC3966' });\n// 'tel:+12133734253'\n```\n\n#### `normalizePhoneNumber(phoneNumber, options?)`\n\nNormalize to E.164 format for storage.\n\n```typescript\nnormalizePhoneNumber('(213) 373-4253', { defaultCountry: 'US' });\n// '+12133734253'\n```\n\n#### `getAllFormats(phoneNumber)`\n\nGet all format variations at once.\n\n```typescript\nconst formats = getAllFormats('+12133734253');\n// {\n//   e164: '+12133734253',\n//   international: '+1 213 373 4253',\n//   national: '(213) 373-4253',\n//   rfc3966: 'tel:+12133734253'\n// }\n```\n\n### Parsing\n\n#### `parsePhoneNumber(phoneNumber, options?)`\n\nParse phone number into components.\n\n```typescript\nconst parsed = parsePhoneNumber('+12133734253');\n// {\n//   countryCode: '1',\n//   nationalNumber: '2133734253',\n//   areaCode: '213',\n//   localNumber: '3734253',\n//   country: 'US',\n//   type: 'FIXED_LINE'\n// }\n```\n\n#### `getPhoneNumberType(phoneNumber, options?)`\n\nIdentify phone number type.\n\n```typescript\ngetPhoneNumberType('+12133734253'); // 'FIXED_LINE'\ngetPhoneNumberType('+16505551234'); // 'MOBILE'\n```\n\n#### `getPhoneCountryCode(phoneNumber, options?)`\n\nGet country code from phone number.\n\n```typescript\ngetPhoneCountryCode('+12133734253'); // 'US'\ngetPhoneCountryCode('+447400123456'); // 'GB'\n```\n\n#### `getCallingCode(phoneNumber)`\n\nGet calling code from phone number.\n\n```typescript\ngetCallingCode('+12133734253'); // '1'\ngetCallingCode('+447400123456'); // '44'\n```\n\n### As-You-Type Formatting\n\n#### `createAsYouTypeFormatter(options?)`\n\nCreate formatter for progressive input.\n\n```typescript\nconst formatter = createAsYouTypeFormatter({ defaultCountry: 'US' });\n\nformatter.input('2'); // '2'\nformatter.input('1'); // '21'\nformatter.input('3'); // '(213)'\nformatter.input('3'); // '(213) 3'\nformatter.input('7'); // '(213) 37'\nformatter.input('3'); // '(213) 373'\nformatter.input('4'); // '(213) 373-4'\nformatter.input('2'); // '(213) 373-42'\nformatter.input('5'); // '(213) 373-425'\nformatter.input('3'); // '(213) 373-4253'\n\nformatter.isValid(); // true\nformatter.reset(); // Start over\n```\n\n### Masking & Privacy\n\n#### `maskPhoneNumber(phoneNumber, options?)`\n\nMask phone number for privacy.\n\n```typescript\nmaskPhoneNumber('+12133734253');\n// '+1 (***) ***-4253' (default: last 4 visible)\n\nmaskPhoneNumber('+12133734253', { visibleDigits: 2 });\n// '+1 (***) ***-**53'\n\nmaskPhoneNumber('+12133734253', {\n  visibleDigits: 3,\n  position: 'start'\n});\n// '+1 213-***-****'\n\nmaskPhoneNumber('+12133734253', { maskChar: 'X' });\n// '+1 (XXX) XXX-4253'\n```\n\n### Text Extraction\n\n#### `extractPhoneNumbers(text, options?)`\n\nExtract phone numbers from text.\n\n```typescript\nconst text = 'Call me at +1 (213) 373-4253 or 650-555-1234';\nextractPhoneNumbers(text);\n// ['+12133734253', '+16505551234']\n```\n\n#### `replacePhoneNumbers(text, replacer, options?)`\n\nFind and replace phone numbers.\n\n```typescript\nconst text = 'Contact: +12133734253';\nreplacePhoneNumbers(text, (phone) => maskPhoneNumber(phone));\n// 'Contact: +1 (***) ***-4253'\n```\n\n### Link Generation\n\n#### `generatePhoneLink(phoneNumber)`\n\nGenerate tel: link.\n\n```typescript\ngeneratePhoneLink('+12133734253');\n// 'tel:+12133734253'\n```\n\n#### `generateSmsLink(phoneNumber, body?)`\n\nGenerate SMS link.\n\n```typescript\ngenerateSmsLink('+12133734253');\n// 'sms:+12133734253'\n\ngenerateSmsLink('+12133734253', 'Hello there!');\n// 'sms:+12133734253?body=Hello%20there!'\n```\n\n### Country Utilities\n\n#### `getCountryCallingCode(country)`\n\nGet calling code for country.\n\n```typescript\ngetCountryCallingCode('US'); // '1'\ngetCountryCallingCode('GB'); // '44'\ngetCountryCallingCode('FR'); // '33'\n```\n\n#### `getCountriesForCallingCode(callingCode)`\n\nGet countries for calling code.\n\n```typescript\ngetCountriesForCallingCode('1');\n// ['US', 'CA', 'AG', 'AI', ...]\n```\n\n#### `getSupportedCountries()`\n\nGet all supported countries.\n\n```typescript\nconst countries = getSupportedCountries();\n// ['US', 'CA', 'GB', 'FR', ...]\n```\n\n#### `isCountrySupported(country)`\n\nCheck if country is supported.\n\n```typescript\nisCountrySupported('US'); // true\nisCountrySupported('ZZ'); // false\n```\n\n#### `getExampleNumber(country)`\n\nGet example phone number for country.\n\n```typescript\ngetExampleNumber('US'); // '+12015550123'\ngetExampleNumber('GB'); // '+447400123456'\n```\n\n### Batch Operations\n\n#### `validatePhoneNumbers(phoneNumbers, options?)`\n\nValidate multiple phone numbers.\n\n```typescript\nconst phones = ['+12133734253', 'invalid', '+447400123456'];\nconst results = validatePhoneNumbers(phones);\n// [\n//   { isValid: true, ... },\n//   { isValid: false, errors: [...] },\n//   { isValid: true, ... }\n// ]\n```\n\n#### `formatPhoneNumbers(phoneNumbers, options?)`\n\nFormat multiple phone numbers.\n\n```typescript\nformatPhoneNumbers(\n  ['+12133734253', '+447400123456'],\n  { format: 'INTERNATIONAL' }\n);\n// ['+1 213 373 4253', '+44 7400 123456']\n```\n\n#### `normalizePhoneNumbers(phoneNumbers, options?)`\n\nNormalize multiple phone numbers.\n\n```typescript\nnormalizePhoneNumbers(\n  ['(213) 373-4253', '(650) 555-1234'],\n  { defaultCountry: 'US' }\n);\n// ['+12133734253', '+16505551234']\n```\n\n### Comparison\n\n#### `arePhoneNumbersEqual(phoneA, phoneB)`\n\nCheck if two phone numbers are equivalent.\n\n```typescript\narePhoneNumbersEqual('+12133734253', '+1 (213) 373-4253'); // true\narePhoneNumbersEqual('+12133734253', '+12133734254'); // false\n```\n\n#### `comparePhoneNumbers(phoneA, phoneB)`\n\nCompare phone numbers for sorting.\n\n```typescript\ncomparePhoneNumbers('+12133734253', '+12133734253'); // 0\ncomparePhoneNumbers('+12133734252', '+12133734253'); // -1\ncomparePhoneNumbers('+12133734254', '+12133734253'); // 1\n```\n\n## Error Handling\n\nFunctions return `null` for invalid inputs or use structured error results:\n\n```typescript\n// Safe wrapper functions return PhoneResult<T>\nconst result = validatePhoneNumberSafe('invalid');\n// {\n//   success: false,\n//   error: 'Invalid phone number',\n//   details: {\n//     code: 'INVALID_FORMAT',\n//     field: 'phoneNumber'\n//   }\n// }\n```\n\n## Real-World Examples\n\n### Contact Form Validation\n\n```typescript\nfunction validatePhoneInput(input: string, country: string) {\n  const result = validatePhoneNumber(input, { defaultCountry: country });\n\n  if (!result.isValid) {\n    return {\n      valid: false,\n      error: 'Please enter a valid phone number'\n    };\n  }\n\n  // Store normalized version\n  const normalized = normalizePhoneNumber(input, { defaultCountry: country });\n\n  return {\n    valid: true,\n    value: normalized\n  };\n}\n```\n\n### Display Formatting\n\n```typescript\nfunction displayPhone(storedNumber: string, format: 'local' | 'international') {\n  const phoneFormat = format === 'local' ? 'NATIONAL' : 'INTERNATIONAL';\n  return formatPhoneNumber(storedNumber, { format: phoneFormat });\n}\n\ndisplayPhone('+12133734253', 'local');\n// '(213) 373-4253'\n\ndisplayPhone('+12133734253', 'international');\n// '+1 213 373 4253'\n```\n\n### Privacy Protection\n\n```typescript\nfunction displaySecurePhone(phoneNumber: string) {\n  return maskPhoneNumber(phoneNumber, {\n    visibleDigits: 4,\n    position: 'end'\n  });\n}\n\ndisplaySecurePhone('+12133734253');\n// '+1 (***) ***-4253'\n```\n\n### Click-to-Call\n\n```typescript\nfunction createCallLink(phoneNumber: string, displayText?: string) {\n  const link = generatePhoneLink(phoneNumber);\n  const display = displayText || formatPhoneNumber(phoneNumber, {\n    format: 'NATIONAL'\n  });\n\n  return `<a href=\"${link}\">${display}</a>`;\n}\n\ncreateCallLink('+12133734253');\n// '<a href=\"tel:+12133734253\">(213) 373-4253</a>'\n```\n\n## TypeScript Support\n\nFully typed with TypeScript. Import types:\n\n```typescript\nimport type {\n  PhoneValidationOptions,\n  PhoneValidationResult,\n  PhoneFormat,\n  PhoneType,\n  PhoneComponents,\n  PhoneResult\n} from '@bernierllc/phone-tools';\n```\n\n## Testing\n\n```bash\n# Run tests\nnpm test\n\n# Run tests with coverage\nnpm run test:coverage\n\n# Run tests once (no watch)\nnpm run test:run\n```\n\n## Quality Standards\n\n- ✅ 91%+ test coverage (statements)\n- ✅ 100% function coverage\n- ✅ TypeScript strict mode\n- ✅ Zero linting errors\n- ✅ Production-ready\n\n## Dependencies\n\n- **libphonenumber-js** - Phone number validation engine\n  - 8.6M+ weekly downloads\n  - Actively maintained\n  - Full TypeScript support\n  - Smaller bundle size than google-libphonenumber (145 KB vs 550 KB)\n\n## Integration Status\n\n- **Logger**: Not applicable (core utility)\n- **Docs-Suite**: Ready (TypeScript documentation)\n- **NeverHub**: Not applicable (pure utility)\n\n## License\n\nCopyright (c) 2025 Bernier LLC\n\nThis file is licensed to the client under a limited-use license. The client may use and modify this code *only within the scope of the project it was delivered for*. Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.\n\n## See Also\n\n- [@bernierllc/sms-sender](../sms-sender) - SMS sending service (uses phone-tools for validation)\n- [@bernierllc/validators-phone](../../validators/validators-phone) - Domain validator (uses phone-tools primitives)\n- [@bernierllc/contact-manager](../contact-manager) - Contact management (uses phone-tools for normalization)\n","readmeFilename":"README.md"}