{"_id":"countries-ts","_rev":"8-dce8d382e339fbe88e66a47cbe6ce518","name":"countries-ts","dist-tags":{"latest":"2.1.0"},"versions":{"1.0.0":{"name":"countries-ts","version":"1.0.0","keywords":["javascript","countries"],"author":{"name":"Esmat Nawahda"},"license":"ISC","_id":"countries-ts@1.0.0","maintainers":[{"name":"geniucode-dev","email":"service@getdazz.com"}],"homepage":"https://github.com/esmat-nawahda/countries#readme","bugs":{"url":"https://github.com/esmat-nawahda/countries/issues"},"dist":{"shasum":"ff4c0d0051ab24c43dadaa8886a40ed2428ce540","tarball":"https://registry.npmjs.org/countries-ts/-/countries-ts-1.0.0.tgz","fileCount":14,"integrity":"sha512-YWPBSZXizFgfBaivNuUn1y8zbA2UD9F6KRapE6SHgWVTtMv+WWmJ5DgarODjQzS2hPBYHXO2tMk4J1lGbFTSOQ==","signatures":[{"sig":"MEQCIB49G0eOJZgWqDeOJ/LF/9FGi2rzHlUbUPx9BGzUTHPVAiBnd7nTAZKmObiCctPDUuDILIha7lQVJE76f0mBERH9Kw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":218697},"jest":{"collectCoverageFrom":["src/**/*.ts"],"testPathIgnorePatterns":["lib/**/*.d.ts"]},"main":"lib/index.js","types":"lib/index.d.ts","gitHead":"a1fce7a16670c477ca554d377807c1ef9341d6fa","scripts":{"pub":"npm version patch && npm run build && git add . && git commit -m \"auto commit for npm updates\" && git push && npm publish","lint":"tslint -p tsconfig.json","test":"jest --config jest.config.json","build":"tsc","clean":"del ./lib/*","format":"prettier --write \"src/**/*.ts\"","prepare":"npm run build"},"_npmUser":{"name":"geniucode-dev","email":"service@getdazz.com"},"repository":{"url":"git+https://github.com/esmat-nawahda/countries.git","type":"git"},"_npmVersion":"9.6.7","description":"An elegant TypeScript module to fetch information about countries from a comprehensive JSON data file.","directories":{"lib":"lib"},"_nodeVersion":"16.15.1","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.6.1","tslint":"^6.1.3","ts-jest":"^29.1.1","prettier":"^3.0.0","typescript":"^5.1.6","@types/jest":"^29.5.3","tslint-config-prettier":"^1.18.0"},"_npmOperationalInternal":{"tmp":"tmp/countries-ts_1.0.0_1691432879713_0.9722192173095703","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"countries-ts","version":"1.0.1","keywords":["javascript","countries"],"author":{"name":"Esmat Nawahda"},"license":"ISC","_id":"countries-ts@1.0.1","maintainers":[{"name":"geniucode-dev","email":"service@getdazz.com"}],"homepage":"https://github.com/esmat-nawahda/countries#readme","bugs":{"url":"https://github.com/esmat-nawahda/countries/issues"},"dist":{"shasum":"27c65e2d41953bd37d5ceb557689fa052a4f5730","tarball":"https://registry.npmjs.org/countries-ts/-/countries-ts-1.0.1.tgz","fileCount":14,"integrity":"sha512-fZsN98yF6+i7corKhjr7DFcn3BWZpdA7oYndj0niuRZjIbcZhA0PjyjvUHPPtGkPJ9tVuFs4TtNtIwYUUYbTDQ==","signatures":[{"sig":"MEYCIQC9+f6fLgNeBe3PbgTN1gLhI1YbPRDpkDriej3NnG4htgIhAPaNiBHSAmXm4VIZ5XqkYXgk1dPeQuw/qxB00fE6Z7h4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":218984},"jest":{"collectCoverageFrom":["src/**/*.ts"],"testPathIgnorePatterns":["lib/**/*.d.ts"]},"main":"lib/index.js","types":"lib/index.d.ts","gitHead":"04dd77b214546cc9537dee6ba143c93c43109d7c","scripts":{"pub":"npm version patch && npm run build && git add . && git commit -m \"auto commit for npm updates\" && git push && npm publish","lint":"tslint -p tsconfig.json","test":"jest --config jest.config.json","build":"tsc","clean":"del ./lib/*","format":"prettier --write \"src/**/*.ts\"","prepare":"npm run build"},"_npmUser":{"name":"geniucode-dev","email":"service@getdazz.com"},"repository":{"url":"git+https://github.com/esmat-nawahda/countries.git","type":"git"},"_npmVersion":"9.6.7","description":"An elegant TypeScript module to fetch information about countries from a comprehensive JSON data file.","directories":{"lib":"lib"},"_nodeVersion":"16.15.1","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.6.1","tslint":"^6.1.3","ts-jest":"^29.1.1","prettier":"^3.0.0","typescript":"^5.1.6","@types/jest":"^29.5.3","tslint-config-prettier":"^1.18.0"},"_npmOperationalInternal":{"tmp":"tmp/countries-ts_1.0.1_1691483385945_0.9457765197702768","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"countries-ts","version":"1.0.2","keywords":["javascript","countries"],"author":{"name":"Esmat Nawahda"},"license":"ISC","_id":"countries-ts@1.0.2","maintainers":[{"name":"esmatnawahda","email":"esmat.nawahda@gmail.com"},{"name":"geniucode-dev","email":"service@getdazz.com"}],"homepage":"https://github.com/esmat-nawahda/countries#readme","bugs":{"url":"https://github.com/esmat-nawahda/countries/issues"},"dist":{"shasum":"de3d7f1c0fc44e20e825141efae5e348da3d4179","tarball":"https://registry.npmjs.org/countries-ts/-/countries-ts-1.0.2.tgz","fileCount":14,"integrity":"sha512-KdMYPZ2tpfY0a4vKoE5lr2QNB8c6hp6sT9Xco2a4KLXPqNGE7MGR/z/w+i4F3Tdttlsnf0OFJF7Yyr5wyeqxgQ==","signatures":[{"sig":"MEUCIADm1SQcDoMu2SMN5iRxV/xCxOEBLpY8NY6M6/vGxQKmAiEA4lB7pWNEj/ttACuNmbKHptfvWhN9CC7HuTiB6073ddM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":218984},"jest":{"collectCoverageFrom":["src/**/*.ts"],"testPathIgnorePatterns":["lib/**/*.d.ts"]},"main":"lib/index.js","types":"lib/index.d.ts","gitHead":"b3deb6e223827c037679ba5073bedb1109771a2a","scripts":{"pub":"npm version patch && npm run build && git add . && git commit -m \"auto commit for npm updates\" && git push && npm publish","lint":"tslint -p tsconfig.json","test":"jest --config jest.config.json","build":"tsc","clean":"del ./lib/*","format":"prettier --write \"src/**/*.ts\"","prepare":"npm run build"},"_npmUser":{"name":"esmatnawahda","email":"esmat.nawahda@gmail.com"},"repository":{"url":"git+https://github.com/esmat-nawahda/countries.git","type":"git"},"_npmVersion":"9.6.7","description":"An elegant TypeScript module to fetch information about countries from a comprehensive JSON data file.","directories":{"lib":"lib"},"_nodeVersion":"16.15.1","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.6.1","tslint":"^6.1.3","ts-jest":"^29.1.1","prettier":"^3.0.0","typescript":"^5.1.6","@types/jest":"^29.5.3","tslint-config-prettier":"^1.18.0"},"_npmOperationalInternal":{"tmp":"tmp/countries-ts_1.0.2_1691484306392_0.2510564962577697","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"countries-ts","version":"1.0.3","keywords":["javascript","countries"],"author":{"name":"Esmat Nawahda"},"license":"ISC","_id":"countries-ts@1.0.3","maintainers":[{"name":"esmatnawahda","email":"esmat.nawahda@gmail.com"},{"name":"geniucode-dev","email":"service@getdazz.com"}],"homepage":"https://github.com/esmat-nawahda/countries#readme","bugs":{"url":"https://github.com/esmat-nawahda/countries/issues"},"dist":{"shasum":"527276e25cff988d32a6e355d6037322b3fcf673","tarball":"https://registry.npmjs.org/countries-ts/-/countries-ts-1.0.3.tgz","fileCount":14,"integrity":"sha512-iTxArQp/Xv7wlMu6uF4lAKxfNUAsEgfJ2+hoXs1bPzvafJXRNuhS3zYhvD9+RFAbapuM0aH/Vh/8jsZ9/z8wSA==","signatures":[{"sig":"MEYCIQDm5tKqELnsNxBePqngzbzFkzrp+l6r6aO8MKE5MlOg6QIhAIU48d+BwxIP9JjCK0NHup0FZsmcrw24bv18K5O75thE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":218999},"jest":{"collectCoverageFrom":["src/**/*.ts"],"testPathIgnorePatterns":["lib/**/*.d.ts"]},"main":"lib/index.js","types":"lib/index.d.ts","gitHead":"c99659ebff709afb2e8dcbdbe8d8bd48b4c0981c","scripts":{"pub":"npm version patch && npm run build && git add . && git commit -m \"auto commit for npm updates\" && git push && npm publish","lint":"tslint -p tsconfig.json","test":"jest --config jest.config.json","build":"tsc","clean":"del ./lib/*","format":"prettier --write \"src/**/*.ts\"","prepare":"npm run build"},"_npmUser":{"name":"esmatnawahda","email":"esmat.nawahda@gmail.com"},"repository":{"url":"git+https://github.com/esmat-nawahda/countries.git","type":"git"},"_npmVersion":"9.6.7","description":"An elegant TypeScript module to fetch information about countries from a comprehensive JSON data file.","directories":{"lib":"lib"},"_nodeVersion":"16.15.1","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.6.1","tslint":"^6.1.3","ts-jest":"^29.1.1","prettier":"^3.0.0","typescript":"^5.1.6","@types/jest":"^29.5.3","tslint-config-prettier":"^1.18.0"},"_npmOperationalInternal":{"tmp":"tmp/countries-ts_1.0.3_1691485355957_0.4209741497056856","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"countries-ts","version":"2.0.0","keywords":["countries","country","country-data","country-codes","iso-3166","currencies","languages","regions","capitals","flags","phone-codes","validation","search","typescript","country-list","country-information","country-search","country-validation","i18n","internationalization","geography"],"author":{"name":"Esmat Nawahda"},"license":"ISC","_id":"countries-ts@2.0.0","maintainers":[{"name":"esmatnawahda","email":"esmat.nawahda@gmail.com"},{"name":"mohammedfaraj","email":"function.faraj@gmail.com"},{"name":"geniucode-dev","email":"service@getdazz.com"}],"homepage":"https://github.com/esmat-nawahda/countries#readme","bugs":{"url":"https://github.com/esmat-nawahda/countries/issues"},"dist":{"shasum":"95ce1bdac515b4cc257ed9db910496584db65c12","tarball":"https://registry.npmjs.org/countries-ts/-/countries-ts-2.0.0.tgz","fileCount":18,"integrity":"sha512-O14W6Rh15zhLRy4x62GCtCFX6wDv3B6g55Rmf7BQzuxNhkI8pltg6tbCG5JiFJbS7iHL8GlEe3jCv5s6LHwEaQ==","signatures":[{"sig":"MEUCIQCRQK1W/3HeUHY521YBAlzW7B36JiUDfqc7n7BTmIWH2wIgNQHt+FglT9nFH1LopHFyBJ0LOkIy4xf9TEctwtmXf58=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":190715},"jest":{"collectCoverageFrom":["src/**/*.ts"],"testPathIgnorePatterns":["lib/**/*.d.ts"]},"main":"lib/index.js","types":"lib/index.d.ts","gitHead":"1afc9e84c612c277c31432fc11f4e1bbcd3096ba","scripts":{"pub":"npm version patch && npm run build && git add . && git commit -m \"auto commit for npm updates\" && git push && npm publish","lint":"tslint -p tsconfig.json","test":"jest --config jest.config.json","build":"tsc","clean":"del ./lib/*","format":"prettier --write \"src/**/*.ts\"","prepare":"npm run build"},"_npmUser":{"name":"geniucode-dev","email":"service@getdazz.com"},"repository":{"url":"git+https://github.com/esmat-nawahda/countries.git","type":"git"},"_npmVersion":"10.5.0","description":"A powerful TypeScript library with 60+ functions for country data - search, validate, format, compare, and more. Zero dependencies.","directories":{"lib":"lib"},"_nodeVersion":"20.12.2","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.6.1","tslint":"^6.1.3","ts-jest":"^29.1.1","prettier":"^3.0.0","typescript":"^5.1.6","@types/jest":"^29.5.3","tslint-config-prettier":"^1.18.0"},"_npmOperationalInternal":{"tmp":"tmp/countries-ts_2.0.0_1753769083168_0.9379500918712662","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"countries-ts","version":"2.1.0","description":"A powerful TypeScript library with 60+ functions for country data - search, validate, format, compare, and more. Zero dependencies.","main":"lib/index.js","types":"lib/index.d.ts","jest":{"testPathIgnorePatterns":["lib/**/*.d.ts"],"collectCoverageFrom":["src/**/*.ts"]},"scripts":{"test":"jest --config jest.config.json","format":"prettier --write \"src/**/*.ts\"","lint":"tslint -p tsconfig.json","prepare":"npm run build","clean":"del ./lib/*","build":"tsc","pub":"npm version patch && npm run build && git add . && git commit -m \"auto commit for npm updates\" && git push && npm publish"},"repository":{"type":"git","url":"git+https://github.com/esmat-nawahda/countries.git"},"keywords":["countries","country","country-data","country-codes","iso-3166","currencies","languages","regions","capitals","flags","phone-codes","validation","search","typescript","country-list","country-information","country-search","country-validation","i18n","internationalization","geography"],"bugs":{"url":"https://github.com/esmat-nawahda/countries/issues"},"homepage":"https://github.com/esmat-nawahda/countries#readme","author":{"name":"Esmat Nawahda"},"license":"ISC","devDependencies":{"@types/jest":"^29.5.3","jest":"^29.6.1","prettier":"^3.0.0","ts-jest":"^29.1.1","tslint":"^6.1.3","tslint-config-prettier":"^1.18.0","typescript":"^5.1.6"},"directories":{"lib":"lib"},"_id":"countries-ts@2.1.0","gitHead":"c5dff71a7cb12d3e2be15b2df296703340f3a5e4","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-LwEgcRXb7+OX1cDxGOfP1+KIWi7nnFoaim1/9giJRRcKoRwUJLHxXtgFAph5n7O8Mx7zVn0UPTgL0VStciy7tQ==","shasum":"e72806e1a17caabf45909df70c50eaa49ce64c20","tarball":"https://registry.npmjs.org/countries-ts/-/countries-ts-2.1.0.tgz","fileCount":20,"unpackedSize":197660,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHKuYKXXgYHedsKsmFoAoYg9RTH9/l4+xAFb/ykJRaU0AiEA/CYVeG4emjNgVfhATEic4LilOOnqqUulS93U13LciAY="}]},"_npmUser":{"name":"geniucode-dev","email":"service@getdazz.com"},"maintainers":[{"name":"esmatnawahda","email":"esmat.nawahda@gmail.com"},{"name":"mohammedfaraj","email":"function.faraj@gmail.com"},{"name":"geniucode-dev","email":"service@getdazz.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/countries-ts_2.1.0_1753770158532_0.5469245991110432"},"_hasShrinkwrap":false}},"time":{"created":"2023-08-07T18:27:59.709Z","modified":"2025-07-29T06:22:38.907Z","1.0.0":"2023-08-07T18:27:59.981Z","1.0.1":"2023-08-08T08:29:46.100Z","1.0.2":"2023-08-08T08:45:06.576Z","1.0.3":"2023-08-08T09:02:36.134Z","2.0.0":"2025-07-29T06:04:43.340Z","2.1.0":"2025-07-29T06:22:38.718Z"},"bugs":{"url":"https://github.com/esmat-nawahda/countries/issues"},"author":{"name":"Esmat Nawahda"},"license":"ISC","homepage":"https://github.com/esmat-nawahda/countries#readme","keywords":["countries","country","country-data","country-codes","iso-3166","currencies","languages","regions","capitals","flags","phone-codes","validation","search","typescript","country-list","country-information","country-search","country-validation","i18n","internationalization","geography"],"repository":{"type":"git","url":"git+https://github.com/esmat-nawahda/countries.git"},"description":"A powerful TypeScript library with 60+ functions for country data - search, validate, format, compare, and more. Zero dependencies.","maintainers":[{"name":"esmatnawahda","email":"esmat.nawahda@gmail.com"},{"name":"mohammedfaraj","email":"function.faraj@gmail.com"},{"name":"geniucode-dev","email":"service@getdazz.com"}],"readme":"# Country Information Finder 🌎\n\nA powerful and lightweight TypeScript library providing comprehensive country data and intelligent search capabilities. Access detailed information about countries including currencies, languages, capitals, regions, and more through an extensive API.\n\n## Features 🌟\n\n- **Rich Data Source**: Complete country data including codes, capitals, currencies, languages, flags, and phone codes\n- **Advanced Search**: Fuzzy search with field-specific filtering and advanced query options\n- **Batch Operations**: Process multiple countries efficiently in single operations\n- **Type Safety**: Full TypeScript support with detailed interfaces\n- **Zero Dependencies**: Lightweight and self-contained\n- **60+ Functions**: Extensive API covering every use case\n- **Validation Utilities**: Built-in validators for country codes, currencies, and phone numbers\n- **Export Capabilities**: Export data as CSV or JSON\n- **Comparison Tools**: Compare countries by region, currency, and language\n\n## Installation 📦\n\n```bash\n# npm\nnpm install countries-ts\n\n# yarn\nyarn add countries-ts\n\n# pnpm\npnpm add countries-ts\n```\n\n## Quick Start 🚀\n\n```typescript\nimport { \n  searchCountries, \n  getByCode, \n  formatCountryName,\n  getCurrencyDetails \n} from 'countries-ts';\n\n// Search for countries\nconst countries = searchCountries('united');\n// Returns: United States, United Kingdom, United Arab Emirates\n\n// Get detailed country information\nconst usa = getByCode('US');\nconsole.log(usa.capital); // Washington, D.C.\n\n// Format country names\nconsole.log(formatCountryName('US')); // United States of America (US)\n\n// Get currency information\nconst usdInfo = getCurrencyDetails('USD');\nconsole.log(usdInfo.countries); // List of countries using USD\n```\n\n## Core API Reference 📘\n\n### Basic Queries\n\n#### `getByCode(code: string): Country | undefined`\nGet country by ISO 3166-1 alpha-2 code.\n```typescript\nconst japan = getByCode('JP');\n```\n\n#### `getByAlpha2(alpha2: string): Country | undefined`\nGet country by ISO 3166-1 alpha-2 code (case-insensitive).\n```typescript\nconst usa = getByAlpha2('US');\nconst uk = getByAlpha2('gb'); // Case-insensitive\n```\n\n#### `getByAlpha3(alpha3: string): Country | undefined`\nGet country by ISO 3166-1 alpha-3 code (case-insensitive).\n```typescript\nconst germany = getByAlpha3('DEU');\nconst canada = getByAlpha3('can'); // Case-insensitive\n```\n\n#### `getByCountry(name: string): Country | undefined`\nGet country by name.\n```typescript\nconst france = getByCountry('France');\n```\n\n#### `getByCodeArea(region: string): Country[]`\nGet countries by region code.\n```typescript\nconst europeanCountries = getByCodeArea('EU');\n```\n\n#### `getByCurrency(code: string): Country[]`\nGet countries using a specific currency.\n```typescript\nconst euroCountries = getByCurrency('EUR');\n```\n\n#### `getByLanguage(code: string): Country[]`\nGet countries by language code.\n```typescript\nconst spanishSpeaking = getByLanguage('es');\n```\n\n#### `getByCountryCode(phoneCode: string): Country | undefined`\nGet country by phone code.\n```typescript\nconst country = getByCountryCode('+44'); // United Kingdom\n```\n\n#### `listCountries(): Country[]`\nGet all countries.\n```typescript\nconst allCountries = listCountries();\n```\n\n### Search & Filtering\n\n#### `searchCountries(query: string, fields?: (keyof Country)[]): Country[]`\nSearch countries with fuzzy matching.\n```typescript\n// Search in all default fields\nconst results = searchCountries('par');\n\n// Search only in capitals\nconst capitals = searchCountries('paris', ['capital']);\n```\n\n#### `searchCountriesAdvanced(query: string, filters?: SearchFilters): Country[]`\nAdvanced search with multiple filters.\n```typescript\nconst filtered = searchCountriesAdvanced('a', {\n  regions: ['EU', 'AS'],\n  currencies: ['EUR', 'USD'],\n  minPopulation: 1000000,\n  maxArea: 500000\n});\n```\n\n### Batch Operations\n\n#### `getByMultipleCodes(codes: string[]): Country[]`\nGet multiple countries at once.\n```typescript\nconst countries = getByMultipleCodes(['US', 'CA', 'MX']);\n```\n\n#### `validateCountryCodes(codes: string[]): { valid: string[], invalid: string[] }`\nValidate multiple country codes.\n```typescript\nconst result = validateCountryCodes(['US', 'XX', 'CA']);\n// { valid: ['US', 'CA'], invalid: ['XX'] }\n```\n\n### Currency Functions\n\n#### `getCurrencies(): CurrencyInfo[]`\nGet all unique currencies.\n```typescript\nconst allCurrencies = getCurrencies();\n```\n\n#### `getByCurrencySymbol(symbol: string): Country[]`\nGet countries by currency symbol.\n```typescript\nconst dollarCountries = getByCurrencySymbol('$');\n```\n\n#### `getCurrencyDetails(code: string): CurrencyInfo | undefined`\nGet detailed currency information.\n```typescript\nconst euroInfo = getCurrencyDetails('EUR');\n// { code: 'EUR', label: 'Euro', symbol: '€', countries: [...] }\n```\n\n### Region Functions\n\n#### `getRegions(): string[]`\nGet all region codes.\n```typescript\nconst regions = getRegions(); // ['AF', 'AS', 'EU', 'NA', 'OC', 'SA']\n```\n\n#### `getRegionName(code: string): string`\nConvert region code to name.\n```typescript\nconst name = getRegionName('EU'); // 'Europe'\n```\n\n#### `getRegionStats(): { region: string, count: number }[]`\nGet country count per region.\n```typescript\nconst stats = getRegionStats();\n```\n\n### Language Functions\n\n#### `getLanguages(): LanguageInfo[]`\nGet all unique languages.\n```typescript\nconst languages = getLanguages();\n```\n\n#### `getLanguageDetails(code: string): LanguageInfo | undefined`\nGet detailed language information.\n```typescript\nconst englishInfo = getLanguageDetails('en');\n```\n\n### Validation & Formatting\n\n#### `isValidCountryCode(code: string): boolean`\nValidate country code.\n```typescript\nisValidCountryCode('US'); // true\nisValidCountryCode('XX'); // false\n```\n\n#### `isValidCurrencyCode(code: string): boolean`\nValidate currency code.\n```typescript\nisValidCurrencyCode('USD'); // true\n```\n\n#### `isValidPhoneCode(code: string): boolean`\nValidate phone code.\n```typescript\nisValidPhoneCode('+1'); // true\n```\n\n#### `formatCountryName(code: string, format?: 'full' | 'short'): string | undefined`\nFormat country name.\n```typescript\nformatCountryName('US'); // 'United States of America (US)'\nformatCountryName('US', 'short'); // 'United States of America'\n```\n\n#### `formatPhoneNumber(number: string, countryCode: string): string | undefined`\nFormat phone number with country code.\n```typescript\nformatPhoneNumber('2025551234', 'US'); // '+1 2025551234'\n```\n\n### Comparison & Analysis\n\n#### `compareCountries(code1: string, code2: string): ComparisonResult | undefined`\nCompare two countries.\n```typescript\nconst comparison = compareCountries('US', 'CA');\n// { sameRegion: true, sameCurrency: false, sameLanguage: true }\n```\n\n#### `getNeighboringCountries(code: string): Country[]`\nGet countries in the same region.\n```typescript\nconst neighbors = getNeighboringCountries('FR'); // Other EU countries\n```\n\n### Sorting & Selection\n\n#### `sortCountriesBy(field: keyof Country | 'currency.code' | 'language.code', order?: 'asc' | 'desc'): Country[]`\nSort countries by any field.\n```typescript\nconst byName = sortCountriesBy('label');\nconst byCapital = sortCountriesBy('capital', 'desc');\n```\n\n#### `getRandomCountry(): Country`\nGet a random country.\n```typescript\nconst random = getRandomCountry();\n```\n\n#### `getRandomCountries(count: number): Country[]`\nGet multiple random countries.\n```typescript\nconst randoms = getRandomCountries(5);\n```\n\n### Capital Cities\n\n#### `getCapitals(): { country: string, capital: string }[]`\nGet all capitals sorted alphabetically.\n```typescript\nconst capitals = getCapitals();\n```\n\n#### `getCountryByCapital(capital: string): Country | undefined`\nFind country by capital city.\n```typescript\nconst country = getCountryByCapital('Tokyo'); // Japan\n```\n\n### ISO & Standards\n\n#### `getByIsoCode(iso: string): Country | undefined`\nGet country by ISO numeric code.\n```typescript\nconst country = getByIsoCode('840'); // United States\n```\n\n#### `getIsoCodeMapping(): { [key: string]: string }`\nGet mapping of country codes to ISO codes.\n```typescript\nconst mapping = getIsoCodeMapping();\n// { 'US': '840', 'GB': '826', ... }\n```\n\n### Flag Utilities\n\n#### `getFlagUrl(code: string, size?: '48x36' | '96x72' | '192x144'): string | undefined`\nGet flag image URL.\n```typescript\nconst flag = getFlagUrl('JP', '96x72');\n```\n\n### Export Functions\n\n#### `exportCountriesToCSV(): string`\nExport all countries as CSV.\n```typescript\nconst csv = exportCountriesToCSV();\n```\n\n#### `exportCountriesToJSON(pretty?: boolean): string`\nExport all countries as JSON.\n```typescript\nconst json = exportCountriesToJSON(true);\n```\n\n## Data Structure 📊\n\n### Country Interface\n```typescript\ninterface Country {\n  label: string;           // Country name\n  code: string;            // ISO 3166-1 alpha-2 code\n  capital: string;         // Capital city\n  region: string;          // Region code (EU, AS, etc.)\n  currency: {\n    code: string;          // Currency code (USD, EUR, etc.)\n    label: string;         // Currency name\n    symbol: string | null; // Currency symbol\n  };\n  language: {\n    code: string;          // Language code\n    label: string;         // Language name\n  };\n  flag: string;            // Flag image URL\n  countryCode: string;     // Phone country code\n  isoCode: string;         // ISO 3166-1 numeric code\n  demonym?: string;        // Nationality name\n  timezone?: string[];     // Timezones (future)\n  coordinates?: {          // Geographic coordinates (future)\n    latitude: number;\n    longitude: number;\n  };\n  area?: number;           // Area in km² (future)\n  population?: number;     // Population (future)\n  borderCountries?: string[]; // Bordering countries (future)\n  nativeName?: string;     // Native name (future)\n  subregion?: string;      // Subregion (future)\n}\n```\n\n## Examples 💡\n\n### Building a Country Selector\n```typescript\nimport { searchCountries, formatCountryName, getFlagUrl } from 'countries-ts';\n\nfunction CountrySelector({ searchTerm }: { searchTerm: string }) {\n  const countries = searchCountries(searchTerm);\n  \n  return countries.map(country => ({\n    value: country.code,\n    label: formatCountryName(country.code, 'short'),\n    flag: getFlagUrl(country.code, '48x36')\n  }));\n}\n```\n\n### Currency Converter Helper\n```typescript\nimport { getCurrencyDetails, getByCurrency } from 'countries-ts';\n\nfunction getCurrencyInfo(currencyCode: string) {\n  const details = getCurrencyDetails(currencyCode);\n  const countries = getByCurrency(currencyCode);\n  \n  return {\n    ...details,\n    countriesCount: countries.length,\n    mainCountry: countries[0]?.label\n  };\n}\n```\n\n### Regional Statistics\n```typescript\nimport { getRegionStats, getRegionName } from 'countries-ts';\n\nfunction getRegionalAnalysis() {\n  const stats = getRegionStats();\n  \n  return stats.map(stat => ({\n    name: getRegionName(stat.region),\n    code: stat.region,\n    countries: stat.count,\n    percentage: (stat.count / 249 * 100).toFixed(1) + '%'\n  }));\n}\n```\n\n### Phone Validation\n```typescript\nimport { isValidPhoneCode, formatPhoneNumber, getByCode } from 'countries-ts';\n\nfunction validateAndFormatPhone(number: string, countryCode: string) {\n  const country = getByCode(countryCode);\n  \n  if (!country || !isValidPhoneCode(country.countryCode)) {\n    throw new Error('Invalid country');\n  }\n  \n  return formatPhoneNumber(number, countryCode);\n}\n```\n\n### Data Export\n```typescript\nimport { exportCountriesToCSV, getByCodeArea } from 'countries-ts';\n\n// Export specific region as CSV\nfunction exportRegionData(regionCode: string) {\n  const countries = getByCodeArea(regionCode);\n  const csv = countries.map(country => \n    `\"${country.label}\",\"${country.code}\",\"${country.capital}\",\"${country.currency.code}\"`\n  ).join('\\n');\n  \n  return csv;\n}\n\n// Export all data\nconst fullCsv = exportCountriesToCSV();\n```\n\n## Region Codes 🗺️\n\n- `AF` - Africa\n- `AS` - Asia  \n- `EU` - Europe\n- `NA` - North America\n- `OC` - Oceania\n- `SA` - South America\n- `AN` - Antarctica\n\n## Performance 🚄\n\nThe library is designed for optimal performance:\n- Zero dependencies keep bundle size minimal\n- All operations run in memory for fast access\n- Efficient search algorithms for quick results\n- Tree-shakeable exports - only import what you need\n\n## TypeScript Support 🔷\n\nFull TypeScript support with:\n- Complete type definitions for all functions\n- Detailed interfaces for all data structures\n- Proper return type inference\n- IDE autocompletion support\n\n## Browser Support 🌐\n\nWorks in all modern browsers and Node.js environments:\n- Chrome, Firefox, Safari, Edge (latest versions)\n- Node.js 12+\n- React Native compatible\n\n## Contributing 🤝\n\nWe welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License 📄\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Changelog 📝\n\n### v2.0.0 (Latest)\n- Added 50+ new functions\n- Advanced search capabilities\n- Batch operations support\n- Currency and language utilities\n- Region statistics and mapping\n- Validation and formatting helpers\n- Export functionality (CSV/JSON)\n- Comparison and analysis tools\n- Flag URL utilities\n- Random country selection\n- ISO code support\n- Performance improvements\n\n### v1.0.0\n- Initial release\n- Basic country queries\n- TypeScript support\n\n## Support 💬\n\n- 🐛 [Report bugs](https://github.com/esmat-nawahda/countries/issues)\n- 💡 [Request features](https://github.com/esmat-nawahda/countries/issues)\n- 📖 [Read the docs](https://github.com/esmat-nawahda/countries#readme)\n- ⭐ [Star on GitHub](https://github.com/esmat-nawahda/countries)\n\n---\n\nMade with ❤️ by the community. Special thanks to all [contributors](https://github.com/esmat-nawahda/countries/graphs/contributors)!\n\n","readmeFilename":"README.md"}