{"id":21147827,"url":"https://github.com/siamahnaf/country-data-codes","last_synced_at":"2025-06-13T11:35:45.711Z","repository":{"id":65006686,"uuid":"577167916","full_name":"siamahnaf/country-data-codes","owner":"siamahnaf","description":"Easy and Simple Country Data and Code Management solution🤷","archived":false,"fork":false,"pushed_at":"2024-09-17T13:09:08.000Z","size":14,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-14T09:06:01.424Z","etag":null,"topics":["calling-codes","country-codes","country-data","currency","currency-symbol","dial-code","javascript"],"latest_commit_sha":null,"homepage":"https://github.com/siamahnaf/country-data-codes","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/siamahnaf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-12T05:51:07.000Z","updated_at":"2024-09-17T13:09:13.000Z","dependencies_parsed_at":"2024-01-07T12:24:19.856Z","dependency_job_id":"ff4fa589-7fde-469b-925b-147a71fb1847","html_url":"https://github.com/siamahnaf/country-data-codes","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"1f1bd7645a94582ab2986c31a43876f6cafccbd6"},"previous_names":["siamahnaf198/country-data-codes"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siamahnaf%2Fcountry-data-codes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siamahnaf%2Fcountry-data-codes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siamahnaf%2Fcountry-data-codes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siamahnaf%2Fcountry-data-codes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/siamahnaf","download_url":"https://codeload.github.com/siamahnaf/country-data-codes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225507511,"owners_count":17483515,"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":["calling-codes","country-codes","country-data","currency","currency-symbol","dial-code","javascript"],"created_at":"2024-11-20T09:18:46.395Z","updated_at":"2025-06-13T11:35:45.680Z","avatar_url":"https://github.com/siamahnaf.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://res.cloudinary.com/dub0dpenl/image/upload/v1731780157/Personal%20Logo/logo-white_e6fujz.png\"\u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://res.cloudinary.com/dub0dpenl/image/upload/v1731780152/Personal%20Logo/logo-dark_qqwrqu.png\"\u003e\n  \u003cimg alt=\"Siam Ahnaf\" src=\"https://res.cloudinary.com/dub0dpenl/image/upload/v1731780152/Personal%20Logo/logo-dark_qqwrqu.png\" height=\"auto\" width=\"240\"\u003e\n\u003c/picture\u003e\n\nCountry Data Codes\n==========\n\nA node js package to get country data including country name, code, currency information, emoji etc.\n\n## Introduction\nA simple but useful functional node packages with all country data. It includes all useful country data gives several function to complete your project.\n\n## Countries\n\nThe data currently provided for each country is:\n\n  * `id` The unique id number for the array\n  * `name` The english name for the country\n  * `isoAlpha2` The [ISO 3166-1 alpha 2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code\n  * `isoAlpha3` The [ISO 3166-1 alpha 3](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) code\n  * `isoNumeric` The [ISO 3166-1 numeric](https://en.wikipedia.org/wiki/ISO_3166-1_numeric)\n  * `currency` An object with currency info.\n  \n    - `code` The [ISO 4217 currency codes](http://en.wikipedia.org/wiki/ISO_4217)\n    - `name` The currency name\n    - `symbol` The currency symbol\n    \n  * `flag` Country flag base64 data\n  * `languages` An array of [ISO 639-2](http://en.wikipedia.org/wiki/ISO_639-2) codes for languages.\n  * `countryCallingCodes` The international call prefixes for this country.\n  * `emoji` The emoji of country's flag.\n\n## Installation\n\n```bash\n$ npm i country-data-codes\n```\n```bash\nimport { getCountryList } from \"country-data-codes\";\nor\nconst { getCountryList } = require(\"country-data-codes\")\n```\nExample\n```bash\nconsole.log(getCountryList()); //Returns all country list\n```\n\n## Methods\n### getCurrency(countryCode)\nReturns the country's currency info by providing country code.\n\nExample\n```bash\nimport { getCurrency, GetCurrencyTypes } from \"country-data-codes\";\n\nconst currencyInfo: GetCurrencyTypes = getCurrency(\"BD\"); // Here country code can be isoAlpha2 or isoAlpha3\n\nconsole.log(currencyInfo)\n```\nReturn values-\n* `name` currency name\n* `code` currency code\n* `symbol` currency symbol\n\n### getCallingCode(countryCode)\nReturns the country's calling code. It returns an array of string.\n\nExample\n```bash\nimport { getCallingCode, GetCallingCodeTypes } from \"country-data-codes\";\n\nconst dialingCode: GetCallingCodeTypes = getCallingCode(\"BD\")\n\nconsole.log(dialingCode) // Give the country code(isoAlpha2 or isoAlpha3)\n//{\n  code: \"880\",\n  format: \"+880\",\n  flag: \"\" //Base64 flash data\n}\n```\n### getLanguages(countryCode)\nReturns the country's languages. It returns an array of string;\n\nExample\n```bash\nimport { getLanguages } from \"country-data-codes\";\n\nconsole.log(getLanguages(\"BD\")) // Give the country code(isoAlpha2 or isoAlpha3)\n//[\"ben\"]\n```\n\n### getFlagBase64(countryCode)\nReturns the country's flag image as base64 data\n\nExample\n```bash\nimport { getFlagBase64 } from \"country-data-codes\";\n\nconst flag = getFlagBase64(\"BD\") // Give the country code(isoAlpha2 or isoAlpha3)\n\n//\u003cimg src=`data:image/png;base64, ${flag}`/\u003e\n```\n\n### lookup(query)\nYou can search and find any country's data by any parameter, like-\n* by `name`: You can search and find data by country name\n* by `countryCode`: You can search and find data by country code\n* by `callingCode`: You can search and find data by country calling code\n* by `currencyName`: You can search and find data by country currency name\n* by `currencyCode`: You can search and find data by country currency code\n* by `currencySymbol`: You can search and find data by country currency symbol\n* by `isoNumeric`: You can search and find data by country iso numeric\n\nExample\n```bash\nimport { lookup, CountryDataTypes } from \"country-data-codes\";\n\nconst data: CountryDataTypes = lookup({name: \"Bangladesh\"})\nconst data: CountryDataTypes = lookup({countryCode: \"BD\"})\nconst data: CountryDataTypes = lookup({callingCode: \"+880\"})\nconst data: CountryDataTypes = lookup({currencyName: \"taka\"})\nconst data: CountryDataTypes = lookup({currencyCode: \"BDT\"})\nconst data: CountryDataTypes = lookup({currencySymbol: \"৳\"})\n```\n\n### removeDialCode()\nYou can remove dial code from a phone number and get a string value.\n\nExample\n```bash\nimport { removeDialCode } from \"country-data-codes\";\n\nconst phone = removeDialCode(\"+8801611994404\")\n\n//undefined or\n//01611994403\n```\n\n## Issues or correction\nIf you face any issues to any function or see any wrong information about country, please let me know.\n\n## Stay in touch\n\n- Author - [Siam Ahnaf](https://www.siamahnaf.com/)\n- Website - [https://www.siamahnaf.com/](https://www.siamahnaf.com/)\n- Twitter - [https://twitter.com/siamahnaf198](https://twitter.com/siamahnaf198)\n- Github - [https://github.com/siamahnaf](https://github.com/siamahnaf)\n\n## License\n\ncountry-data-codes [MIT licensed](LICENSE).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiamahnaf%2Fcountry-data-codes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiamahnaf%2Fcountry-data-codes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiamahnaf%2Fcountry-data-codes/lists"}