{"_id":"@domaindetails/whois-parser","_rev":"6-342b0346c19ffaf07efd12f4153bf7c3","name":"@domaindetails/whois-parser","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.1":{"name":"@domaindetails/whois-parser","version":"1.0.1","keywords":["whois","parser","ccTLD","domain","dns","registry","international","japan","korea","russia","europe"],"author":{"name":"Simple Bytes LLC"},"license":"MIT","_id":"@domaindetails/whois-parser@1.0.1","maintainers":[{"name":"simplebytes_com","email":"info@simplebytes.com"},{"name":"julianengel","email":"julian@codeero.com"}],"homepage":"https://github.com/simplebytes-com/whois-parser#readme","bugs":{"url":"https://github.com/simplebytes-com/whois-parser/issues"},"dist":{"shasum":"5a4a8b3c13811ad9e1d24ceda3c3fb7377220352","tarball":"https://registry.npmjs.org/@domaindetails/whois-parser/-/whois-parser-1.0.1.tgz","fileCount":10,"integrity":"sha512-4HeXQQeNiI0gJXnThgXMrCqIVAyodlc0+fv8LG6D0322t+4C6Exa0JF8mIsfZk5it/vHpZWZLMvHpHjS1yD3+Q==","signatures":[{"sig":"MEQCIDYQFEcPUHURUQiI+yaJOGrwJ0NewSliYVspgHdBXbn+AiAfufmxwr2wwZVd75z+a3r0Z/pUy3+v4wpoDegA44vioQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":84538},"main":"whois-parser.js","type":"module","engines":{"node":">=18.0.0"},"gitHead":"2cf36c479401912d468ccfbf772da763cb7c76be","scripts":{"test":"node test-full.js","sync-iana":"node fetch-iana-servers.js","test:sample":"node test-sample.js","sync-iana:dry-run":"node fetch-iana-servers.js --dry-run"},"_npmUser":{"name":"simplebytes_com","email":"info@simplebytes.com"},"repository":{"url":"git+https://github.com/simplebytes-com/whois-parser.git","type":"git"},"_npmVersion":"10.9.3","description":"Comprehensive WHOIS parser with support for 169 country-code TLDs (ccTLDs)","directories":{},"_nodeVersion":"22.20.0","dependencies":{"node-fetch":"^3.3.2"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/whois-parser_1.0.1_1766141313506_0.38365824325845366","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@domaindetails/whois-parser","version":"1.0.2","keywords":["whois","parser","ccTLD","domain","dns","registry","international","japan","korea","russia","europe"],"author":{"name":"Simple Bytes LLC"},"license":"MIT","_id":"@domaindetails/whois-parser@1.0.2","maintainers":[{"name":"simplebytes_com","email":"info@simplebytes.com"},{"name":"julianengel","email":"julian@codeero.com"}],"homepage":"https://github.com/simplebytes-com/whois-parser#readme","bugs":{"url":"https://github.com/simplebytes-com/whois-parser/issues"},"dist":{"shasum":"61045757b0fe2da0c1edf044b333ffdbcc950466","tarball":"https://registry.npmjs.org/@domaindetails/whois-parser/-/whois-parser-1.0.2.tgz","fileCount":10,"integrity":"sha512-vg16I77QLA6s3daWkLVB3qIKR1fWcUHU4mJe6oTJ/JWs1wjmheKEILcXsCkCVotJACj2FCg0WI6uqKm7jyW1hA==","signatures":[{"sig":"MEUCIQCb7EG5chm9o3S9fADTSiS0jy6xC2MV/Hmar+FToYGKyQIgAf1Rrht4vflppUGYiBX1vRf6rh/1XRlODltUumGS5zA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":74006},"main":"whois-parser.js","type":"module","engines":{"node":">=18.0.0"},"gitHead":"d78a91761c9c9462dbe097affd9d75c07966983f","scripts":{"test":"node test-full.js","sync-iana":"node fetch-iana-servers.js","test:sample":"node test-sample.js","sync-iana:dry-run":"node fetch-iana-servers.js --dry-run"},"_npmUser":{"name":"simplebytes_com","email":"info@simplebytes.com"},"repository":{"url":"git+https://github.com/simplebytes-com/whois-parser.git","type":"git"},"_npmVersion":"10.9.3","description":"Comprehensive WHOIS parser with support for 169 country-code TLDs (ccTLDs)","directories":{},"_nodeVersion":"22.20.0","dependencies":{},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/whois-parser_1.0.2_1766141662363_0.050109080540049034","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@domaindetails/whois-parser","version":"1.0.3","keywords":["whois","parser","ccTLD","domain","dns","registry","international","japan","korea","russia","europe"],"author":{"name":"Simple Bytes LLC"},"license":"MIT","_id":"@domaindetails/whois-parser@1.0.3","maintainers":[{"name":"simplebytes_com","email":"info@simplebytes.com"},{"name":"julianengel","email":"julian@codeero.com"}],"homepage":"https://github.com/simplebytes-com/whois-parser#readme","bugs":{"url":"https://github.com/simplebytes-com/whois-parser/issues"},"dist":{"shasum":"9af92e36bc4ff8c14aa8691c8b057c1e6965bef2","tarball":"https://registry.npmjs.org/@domaindetails/whois-parser/-/whois-parser-1.0.3.tgz","fileCount":10,"integrity":"sha512-T0C4rIa3NF5HWrmtaz+JW7h5QryMWS4sWEcfkuAizlKPJNNmdW1n33RGx7l0fWGvlAkllVwtNdW/evURkmk1ZQ==","signatures":[{"sig":"MEYCIQDhEdCqkVDIlg1agc95PaGkWZ+YrlJVli8sndFvc7rgAwIhAI23GYYzOfDZLV46rlbj3VHH/tBzAqm0IhQF1jsQgy/u","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":74044},"main":"whois-parser.js","type":"module","engines":{"node":">=18.0.0"},"gitHead":"d78a91761c9c9462dbe097affd9d75c07966983f","scripts":{"test":"node test-full.js","sync-iana":"node fetch-iana-servers.js","test:sample":"node test-sample.js","sync-iana:dry-run":"node fetch-iana-servers.js --dry-run"},"_npmUser":{"name":"simplebytes_com","email":"info@simplebytes.com"},"repository":{"url":"git+https://github.com/simplebytes-com/whois-parser.git","type":"git"},"_npmVersion":"10.9.3","description":"Comprehensive WHOIS parser with support for 169 country-code TLDs (ccTLDs)","directories":{},"_nodeVersion":"22.20.0","dependencies":{},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/whois-parser_1.0.3_1766141785392_0.8127748928259715","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@domaindetails/whois-parser","version":"1.1.0","keywords":["whois","parser","ccTLD","domain","dns","registry","international","japan","korea","russia","europe"],"author":{"name":"Simple Bytes LLC"},"license":"MIT","_id":"@domaindetails/whois-parser@1.1.0","maintainers":[{"name":"simplebytes_com","email":"info@simplebytes.com"},{"name":"julianengel","email":"julian@codeero.com"}],"homepage":"https://github.com/simplebytes-com/whois-parser#readme","bugs":{"url":"https://github.com/simplebytes-com/whois-parser/issues"},"dist":{"shasum":"a898d6475c5c176c4f45abb8d07edec253db667f","tarball":"https://registry.npmjs.org/@domaindetails/whois-parser/-/whois-parser-1.1.0.tgz","fileCount":20,"integrity":"sha512-7FMOSxbiKquMjNWlTMM5K/PRH4DOY264AGfoLAvyOtE9sC4KEOJkaD85+fIpxKPtfcokz4/pTbQDDEzEgB51fg==","signatures":[{"sig":"MEUCIQCS7FonoYGXjsJ2GKcWn+CQ1F5p3eRen4MWmQjo59s4EgIgQhORM2zf/kg1lIog4bPdVr25RJGCzkcTLjT1fWyHHxE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":112805},"main":"whois-parser.js","type":"module","engines":{"node":">=18.0.0"},"exports":{".":"./whois-parser.js","./status-codes":"./status-codes.js","./field-mappings":"./field-mappings.js"},"gitHead":"d78a91761c9c9462dbe097affd9d75c07966983f","scripts":{"test":"vitest run","sync-iana":"node fetch-iana-servers.js","test:live":"node test-live.js","test:watch":"vitest","test:sample":"node test-live.js --sample","test:coverage":"vitest run --coverage","sync-iana:dry-run":"node fetch-iana-servers.js --dry-run"},"_npmUser":{"name":"simplebytes_com","email":"info@simplebytes.com"},"repository":{"url":"git+https://github.com/simplebytes-com/whois-parser.git","type":"git"},"_npmVersion":"10.9.3","description":"Comprehensive WHOIS parser with support for 169 country-code TLDs (ccTLDs)","directories":{},"_nodeVersion":"22.20.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.0"},"_npmOperationalInternal":{"tmp":"tmp/whois-parser_1.1.0_1766143517309_0.608638492702813","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@domaindetails/whois-parser","version":"1.1.1","keywords":["whois","parser","ccTLD","domain","dns","registry","international","japan","korea","russia","europe"],"author":{"name":"Simple Bytes LLC"},"license":"MIT","_id":"@domaindetails/whois-parser@1.1.1","maintainers":[{"name":"simplebytes_com","email":"info@simplebytes.com"},{"name":"julianengel","email":"julian@codeero.com"}],"homepage":"https://github.com/simplebytes-com/whois-parser#readme","bugs":{"url":"https://github.com/simplebytes-com/whois-parser/issues"},"dist":{"shasum":"a0b202addf8d8557637abaa6bef222f1e4fbe30f","tarball":"https://registry.npmjs.org/@domaindetails/whois-parser/-/whois-parser-1.1.1.tgz","fileCount":20,"integrity":"sha512-qwhl5YwE5fQvZ2b8jrb3jPaTBAvSWJ9o+sgg9hxt06CLcNCYHxDkKTPgUK4bj360GoCRpHKWuOhqiolcMhuNEw==","signatures":[{"sig":"MEUCIAlAoQLDrrt0q30EW6m48hgEWT3ouw7R2hUgM1cNASbUAiEAmhm3PnTffHLj+a29t+IMckVuVcRn/kXVFznyeDaFcuU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":113783},"main":"whois-parser.js","type":"module","engines":{"node":">=18.0.0"},"exports":{".":"./whois-parser.js","./status-codes":"./status-codes.js","./field-mappings":"./field-mappings.js"},"gitHead":"d78a91761c9c9462dbe097affd9d75c07966983f","scripts":{"test":"vitest run","sync-iana":"node fetch-iana-servers.js","test:live":"node test-live.js","test:watch":"vitest","test:sample":"node test-live.js --sample","test:coverage":"vitest run --coverage","sync-iana:dry-run":"node fetch-iana-servers.js --dry-run"},"_npmUser":{"name":"simplebytes_com","email":"info@simplebytes.com"},"repository":{"url":"git+https://github.com/simplebytes-com/whois-parser.git","type":"git"},"_npmVersion":"10.9.3","description":"Comprehensive WHOIS parser with support for 169 country-code TLDs (ccTLDs)","directories":{},"_nodeVersion":"22.20.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.0"},"_npmOperationalInternal":{"tmp":"tmp/whois-parser_1.1.1_1766144213522_0.6807624155142116","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@domaindetails/whois-parser","version":"1.2.0","description":"Comprehensive WHOIS parser with support for 169 country-code TLDs (ccTLDs)","type":"module","main":"whois-parser.js","exports":{".":"./whois-parser.js","./status-codes":"./status-codes.js","./field-mappings":"./field-mappings.js"},"scripts":{"test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","test:live":"node test-live.js","test:sample":"node test-live.js --sample","sync-iana":"node fetch-iana-servers.js","sync-iana:dry-run":"node fetch-iana-servers.js --dry-run"},"dependencies":{},"devDependencies":{"vitest":"^2.1.0"},"keywords":["whois","parser","ccTLD","domain","dns","registry","international","japan","korea","russia","europe"],"author":{"name":"Simple Bytes LLC"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/simplebytes-com/whois-parser.git"},"homepage":"https://github.com/simplebytes-com/whois-parser#readme","bugs":{"url":"https://github.com/simplebytes-com/whois-parser/issues"},"engines":{"node":">=18.0.0"},"_id":"@domaindetails/whois-parser@1.2.0","gitHead":"3fa9c6fcbcea6e070825cdfe39b98997428a3f30","_nodeVersion":"22.23.1","_npmVersion":"10.9.8","dist":{"integrity":"sha512-VjmbK6kKRk27awPhQfYksu8U5QiiLu76dfI93G1j9ts3wm4GRefkZRaD9B1AfIzqiPowCbQcv8sM2tuoEXJj9Q==","shasum":"5af5e97d0e1747908043de87500b252ba694c973","tarball":"https://registry.npmjs.org/@domaindetails/whois-parser/-/whois-parser-1.2.0.tgz","fileCount":9,"unpackedSize":94942,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCBAwXf8VJ3qKUS1zJkppCYyoheEQ5TdijlbBQo33TFyQIhAIMW24aaR4hGZqSqq/TjtRF2d04USAj/5viXuEjjlVKp"}]},"_npmUser":{"name":"simplebytes_com","email":"info@simplebytes.com"},"directories":{},"maintainers":[{"name":"simplebytes_com","email":"info@simplebytes.com"},{"name":"julianengel","email":"julian@codeero.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/whois-parser_1.2.0_1783789651650_0.9496491277264538"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-19T10:48:33.421Z","modified":"2026-07-11T17:07:31.915Z","1.0.1":"2025-12-19T10:48:33.666Z","1.0.2":"2025-12-19T10:54:22.511Z","1.0.3":"2025-12-19T10:56:25.548Z","1.1.0":"2025-12-19T11:25:17.473Z","1.1.1":"2025-12-19T11:36:53.681Z","1.2.0":"2026-07-11T17:07:31.803Z"},"bugs":{"url":"https://github.com/simplebytes-com/whois-parser/issues"},"author":{"name":"Simple Bytes LLC"},"license":"MIT","homepage":"https://github.com/simplebytes-com/whois-parser#readme","keywords":["whois","parser","ccTLD","domain","dns","registry","international","japan","korea","russia","europe"],"repository":{"type":"git","url":"git+https://github.com/simplebytes-com/whois-parser.git"},"description":"Comprehensive WHOIS parser with support for 169 country-code TLDs (ccTLDs)","maintainers":[{"name":"simplebytes_com","email":"info@simplebytes.com"},{"name":"julianengel","email":"julian@codeero.com"}],"readme":"Last updated: 2026-07-05\n\n# WHOIS Parser for ccTLDs\n\nA comprehensive, battle-tested WHOIS parser with support for 169 country-code TLDs (ccTLDs) and 1,260+ TLDs total. Built for [DomainDetails.com](https://domaindetails.com) by Simple Bytes LLC.\n\n## WHOIS Server Dictionary\n\nThis repository includes `whois_dict.json` with WHOIS servers for **1,260+ TLDs** (updated from IANA Root Zone Database).\n\n## Overview\n\nThis parser handles the messy reality of WHOIS data across different country registries. Unlike simple regex-based parsers, it handles:\n\n- **Multiple date formats** - from `2005/05/30` (Japan) to `2007. 03. 02.` (South Korea) to natural language dates\n- **International field names** - including Japanese (登録年月日), Korean, and other non-English formats\n- **Various nameserver formats** - square brackets, multi-line sections, colon-separated with IPs\n- **Slow WHOIS servers** - with configurable 30-second timeouts\n- **Fallback parsing** - when domain names aren't explicitly listed in responses\n\n## 📊 Complete Breakdown of All 169 ccTLDs\n\n### ✅ FULLY WORKING (52 - 31%)\n\nAll fields parsed: domain, dates, nameservers, registrar, status\n→ **Ready for production use**\n\n`.ac` `.af` `.ag` `.bh` `.bi` `.bj` `.ci` `.cl` `.co` `.dm` `.do` `.ge` `.gg` `.gi` `.gl` `.hr` `.hu` `.ie` `.io` `.it` `.je` `.jp` `.kr` `.kz` `.la` `.ma` `.me` `.mk` `.mn` `.mx` `.my` `.nu` `.nz` `.pk` `.pt` `.ru` `.sc` `.se` `.sg` `.sh` `.sk` `.so` `.st` `.su` `.sx` `.sy` `.tc` `.td` `.tl` `.us` `.ve` `.ws` `.信息`\n\n### ⚠️ PARTIAL DATA (99 - 59%)\n\nMissing some fields (usually creation date due to registry policy)\n→ **Still useful but incomplete**\n\n**Major TLDs with partial data:**\n- 🇩🇪 `.de` (Germany) - No creation date (registry policy)\n- 🇫🇷 `.fr` (France) - No creation date\n- 🇬🇧 `.uk` (United Kingdom) - No creation date\n- 🇨🇳 `.cn` (China) - No creation date\n- 🇦🇺 `.au` (Australia) - No creation date\n- 🇦🇹 `.at` (Austria) - No creation date\n- 🇧🇪 `.be` (Belgium) - No creation date\n- 🇩🇰 `.dk` (Denmark) - No creation date\n- 🇳🇱 `.nl` (Netherlands) - Partial data\n- 🇵🇱 `.pl` (Poland) - Partial data\n- 🇪🇸 `.es` (Spain) - Authorization required\n- 🇨🇭 `.ch` (Switzerland) - Blocks automated queries\n- 🇮🇳 `.in` (India) - Partial data\n- 🇧🇷 `.br` (Brazil) - Partial data\n- 🇨🇦 `.ca` (Canada) - Partial data\n- 🇪🇺 `.eu` (European Union) - No creation date\n\n### ❌ CANNOT QUERY (18 - 11%)\n\nServer infrastructure issues, cannot be fixed by parser\n\n**Breakdown by error type:**\n- ⏱️ **8 Timeouts** (>30s): `.dz` `.gp` `.mw` `.ng` `.pt` `.sb` `.tk` `.uy`\n- 🚫 **4 Refused**: `.bo` `.cf` `.hm` `.pf`\n- 🌐 **2 DNS Error**: `.iq` `.mz`\n- 📭 **1 No Data**: `.bn`\n- 🔌 **3 Connection Reset**: `.tr` and others\n\n### 💡 Key Insights\n\n1. **Parser Success**: 151/169 (89%) return SOME data\n2. **Full Success**: 52/169 (31%) return ALL data\n3. **Infrastructure Issues**: 18/169 (11%) cannot be queried at all\n\nThe 99 \"partial data\" ccTLDs are often **policy limitations, not bugs**:\n- European registries hiding creation dates for GDPR compliance\n- Some registries require authorization for automated queries\n- Privacy-focused registries redacting sensitive information\n\n### 🌟 Highlighted Format Support\n\n- 🇯🇵 **Japan (.jp)** - Square bracket format with Japanese fields\n- 🇰🇷 **South Korea (.kr)** - Korean/English dual format with wide spacing\n- 🇬🇬 **Guernsey (.gg)**, 🇯🇪 **Jersey (.je)** - Natural language dates\n- 🇷🇺 **Russia (.ru)** - Cyrillic field names with IP-annotated nameservers\n- 🇮🇹 **Italy (.it)** - Multi-line nameserver sections\n- 🇩🇪 **Germany (.de)** - Nserver format\n\n## Features\n\n- **Date Normalization**: Converts all date formats to ISO 8601 (`YYYY-MM-DDTHH:MM:SSZ`)\n- **Multi-Format Parsing**: Handles colon-separated, square bracket, and multi-line formats\n- **Domain Fallback**: Uses input domain when WHOIS doesn't return it explicitly\n- **Robust Error Handling**: Custom error classes for different failure types\n- **Availability Detection**: `isDomainAvailable()` recognizes \"not registered\" responses across 20+ registry formats\n- **Rate-Limit Detection**: `isRateLimited()` distinguishes throttling/access denials (.ch, .es, .it quotas) from real data\n- **Comprehensive Testing**: 160+ unit tests with Vitest framework, fixtures for 13 registry formats\n- **Status Code Normalization**: Normalize registry status codes to EPP standard\n- **Field Mapping Dictionary**: Centralized field name aliases for extensibility\n- **Zero Runtime Dependencies**: Only uses Node.js built-in modules\n\n## What's New in v1.2.0\n\n### Line-Oriented Parsing Engine\n\nField extraction was rewritten from free-text regex matching to line-oriented\nkey/value parsing driven by the alias lists in `field-mappings.js`. This fixes\na class of wrong-data bugs (substring false-positives, values captured from\nthe wrong line) and adds support for sectioned formats: `.uk` (Nominet),\n`.it`, `.nl`, `.ee`, `.dk`, `.fi` and more. Single-line `state:` (.ru) and\nJapanese `[状態]` statuses are now parsed (previously silently dropped).\n\n### Availability & Rate-Limit Detection\n\n```javascript\nimport { parseWhoisData, isDomainAvailable, isRateLimited } from '@domaindetails/whois-parser';\n\nconst parsed = parseWhoisData(rawText, 'example.de');\nparsed.isAvailable;   // true when the registry says the domain is not registered\nparsed.isRateLimited; // true when the response is a quota/access denial, not data\n```\n\nPreviously consumers had to maintain their own \"no match\" pattern lists; those\nwere broad enough to misclassify real records. Detection now lives here, with\nline-anchored per-registry patterns.\n\n### New Parsed Fields\n\n`parseWhoisData()` additionally returns `registrarUrl`, `registrarIanaId`,\n`registrarWhoisServer` (referral target for thin registries),\n`abuseContactEmail`, and `registrantCountry`. When the registrant name is\nprivacy-redacted, the parser now falls back to the first non-redacted\nregistrant field (e.g. `Registrant Organization`).\n\n### Hardened Transport\n\n`whoisQuery()` now converts IDN domains to punycode, uses server-specific\nquery formats (`whois.denic.de -T dn,ace`, `whois.jprs.jp /e` English output,\nVerisign `domain` prefix), tolerates registries that close connections\nabruptly after sending data, and caps response size (1 MiB default,\nconfigurable via `options.maxResponseBytes`).\n\n### Expanded Date Normalization\n\nNew formats normalized to ISO 8601: `01-Dec-2023` (.uk/.ie), `12.6.2006`\n(.fi), `2002.09.19 13:00:00` (.pl), `20240304 13:11:29` (.at),\n`2025/06/01 01:05:04 (JST)` (.jp), short timezone offsets (`+03` → `+03:00`),\nand `Updated Date`/`Changed` fields are now normalized too. Unparseable\nvalues (e.g. .uk `before Aug-1996`) pass through unchanged.\n\n## What's New in v1.1.0\n\n### Custom Error Classes\n\nHandle different error types programmatically:\n\n```javascript\nimport {\n    whoisQuery,\n    ConnectionError,\n    TimeoutError,\n    NoDataError,\n    ValidationError,\n} from '@domaindetails/whois-parser';\n\ntry {\n    const result = await whoisQuery('google.jp', 'whois.jprs.jp');\n} catch (error) {\n    if (error instanceof TimeoutError) {\n        console.log(`Server timed out after ${error.timeoutMs}ms`);\n    } else if (error instanceof ConnectionError) {\n        console.log(`Connection failed to ${error.server}`);\n    } else if (error instanceof ValidationError) {\n        console.log(`Invalid ${error.field}`);\n    }\n}\n```\n\n### Status Code Normalization\n\nNormalize different registry status formats to standard EPP codes:\n\n```javascript\nimport { normalizeStatus, isActive, hasTransferLock } from '@domaindetails/whois-parser/status-codes';\n\n// Normalize various formats to EPP codes\nnormalizeStatus('active');           // → 'ok'\nnormalizeStatus('REGISTERED, DELEGATED'); // → 'ok'\nnormalizeStatus('locked');           // → 'clientTransferProhibited'\n\n// Check domain status\nisActive(['ok', 'clientTransferProhibited']);  // → true\nhasTransferLock(['clientTransferProhibited']); // → true\n```\n\n### Field Mappings\n\nAccess the centralized field name aliases:\n\n```javascript\nimport { NAMESERVER_FIELDS, getFieldAliases } from '@domaindetails/whois-parser/field-mappings';\n\n// Get all aliases for nameserver fields\nconsole.log(getFieldAliases('nameserver'));\n// ['Name Server', 'Nameserver', 'nserver', 'Host Name', '호스트이름', ...]\n```\n\n## WHOIS Server Dictionary Maintenance\n\nThe `whois_dict.json` file is automatically synced with the [IANA Root Zone Database](https://www.iana.org/domains/root/db).\n\n### Sync from IANA\n\n```bash\n# Install dependencies first\nnpm install\n\n# Sync WHOIS servers from IANA (updates whois_dict.json)\nnpm run sync-iana\n\n# Preview changes without saving\nnpm run sync-iana:dry-run\n```\n\nThe sync script:\n- Fetches complete TLD list from `https://data.iana.org/TLD/tlds-alpha-by-domain.txt` (1,439 TLDs)\n- Gets WHOIS server for each TLD from individual IANA pages\n- Updates `whois_dict.json` with sorted results\n- Creates dated backups before making changes\n- Updates README with last sync date\n\n### Automated Updates\n\nA GitHub Action automatically syncs the dictionary:\n- **On every push** to main/master branch\n- **Weekly on Sunday at 2 AM UTC** to catch IANA updates\n- **Manual trigger** via GitHub Actions UI\n\nWhen changes are detected, the action:\n- Updates `whois_dict.json` with new/changed TLD servers\n- Updates README with current date\n- Creates dated backups\n- Commits and pushes changes automatically\n\nSee `.github/workflows/sync-iana.yml` for details.\n\n## Installation\n\n```bash\nnpm install @domaindetails/whois-parser\n```\n\n## Usage\n\n```javascript\nimport { parseWhoisData, whoisQuery } from '@domaindetails/whois-parser';\n\n// Query a WHOIS server\nconst whoisText = await whoisQuery('google.jp', 'whois.jprs.jp');\n\n// Parse the response\nconst parsed = parseWhoisData(whoisText, 'google.jp');\n\nconsole.log(parsed);\n// {\n//   domainName: 'GOOGLE.JP',\n//   registrar: 'Google LLC',\n//   creationDate: '2005-05-30T00:00:00Z',\n//   expirationDate: '2026-05-31T00:00:00Z',\n//   nameservers: ['ns1.google.com', 'ns2.google.com', ...],\n//   registrant: 'Google LLC',\n//   status: ['Active', 'DomainTransferLocked', 'AgentChangeLocked'],\n//   dnssec: null,\n//   lastModified: '2025-06-01T01:05:04.000Z'\n// }\n```\n\n## Testing\n\nRun the comprehensive test suite:\n\n```bash\n# Quick test (19 popular ccTLDs, ~30 seconds)\nnpm run test:sample\n\n# Full test (all 169 ccTLDs, ~5 minutes)\nnpm test\n```\n\n### Test Output\n\n```\n[1/169] Testing .jp (google.jp)...\n  ✅ OK (domain: GOOGLE.JP, created: 2005-05-30T00:00:00Z)\n\n[2/169] Testing .kr (naver.kr)...\n  ✅ OK (domain: naver.kr, created: 2007-03-02T00:00:00Z)\n\n========== SUMMARY ==========\n✅ Successful: 52/169\n⚠️  Parsing Issues: 99/169\n❌ Failed: 18/169\n```\n\n## Supported Formats\n\n### Date Formats\n\n```\n2005/05/30              → 2005-05-30T00:00:00Z  (.jp)\n2007. 03. 02.           → 2007-03-02T00:00:00Z  (.kr)\n30th April 2003         → 2003-04-30T00:00:00Z  (.gg, .je)\n30th April each year    → 2026-04-30T00:00:00Z  (recurring)\n2005-02-14T20:35:14.765Z → 2005-02-14T20:35:14.765Z (standard)\n```\n\n### Field Formats\n\n**Square Brackets** (.jp):\n```\n[Domain Name]                   GOOGLE.JP\n[Name Server]                   ns1.google.com\n[登録年月日]                    2005/05/30\n```\n\n**Colon-Separated** (most ccTLDs):\n```\nDomain Name: google.kr\nRegistered Date: 2007. 03. 02.\nHost Name: ns1.google.com\n```\n\n**Dotted Format** (.ax, .kz):\n```\ndomain...............: test.ax\n```\n\n**Multi-Line** (.gg, .je, .it):\n```\nName servers:\n    ns1.google.com\n    ns2.google.com\n```\n\n## Known Limitations\n\n### Missing Creation Dates\n\nSome registries (.de, .be, .dk, .at, .im) don't publicly expose creation dates via WHOIS. This is a registry policy, not a parser limitation.\n\n### Server Timeouts\n\n6 ccTLDs still timeout even at 30 seconds: .dz, .gp, .mw, .ng, .sb, .tk\n\n### Offline Servers\n\nSome WHOIS servers are permanently offline or block automated queries: .bo, .cf, .ch, .es, .hm, .iq, .mz, .pf, .tr\n\n## Contributing\n\nFound a ccTLD that doesn't parse correctly? We'd love a PR!\n\n1. Run the test suite to identify the failing TLD\n2. Query the WHOIS server manually: `whois -h <server> <domain>`\n3. Identify the unique format patterns\n4. Update `parseWhoisData()` with new patterns\n5. Re-run tests to verify\n\n## Comparison with Other Packages\n\n| Feature | @domaindetails/whois-parser | whoiser | whois | whois-parsed |\n|---------|----------------------------|---------|-------|--------------|\n| **ccTLD Coverage** | 169 TLDs tested | Basic | Basic | Basic |\n| **Date Format Support** | 24+ formats | Basic | None | Basic |\n| **Japanese/Korean/Russian** | Full support | Limited | None | Limited |\n| **Custom Error Classes** | Yes | No | No | No |\n| **Status Normalization** | EPP codes | No | No | No |\n| **Field Mappings** | Extensible | No | No | Hardcoded |\n| **Zero Runtime Deps** | Yes | No | No | No |\n| **Test Coverage** | 76+ tests | Good | Good | Poor |\n| **Active Maintenance** | Yes | Yes | Yes | Stale (3yr) |\n| **SOCKS Proxy** | No | No | Yes | Yes |\n| **Auto TLD Discovery** | Via dictionary | Yes | No | No |\n\n**Our differentiator**: Best-in-class ccTLD WHOIS parsing with comprehensive international format support, custom error handling, and zero runtime dependencies.\n\n## Credits\n\n- **Built by**: [DomainDetails.com](https://domaindetails.com) team\n- **Special thanks**: [@synozeer](https://x.com/synozeer) for spotting .gg and other ccTLD issues\n- **Powered by**: Claude Code for the comprehensive parser refactor\n\n## License\n\nMIT License - feel free to use in your projects!\n\n## Related Projects\n\n- [whois](https://www.npmjs.com/package/whois) - Node.js WHOIS client\n- [whoiser](https://www.npmjs.com/package/whoiser) - Alternative WHOIS parser\n- [DomainDetails.com](https://domaindetails.com) - Free domain lookup tool using this parser\n\n---\n\n**Found this useful?** Give us a star ⭐ at [github.com/simplebytes-com/whois-parser](https://github.com/simplebytes-com/whois-parser) and check out [DomainDetails.com](https://domaindetails.com)!\n","readmeFilename":"README.md"}