{"id":28389792,"url":"https://github.com/meswapnilwagh/worldpedia","last_synced_at":"2026-04-29T23:31:42.759Z","repository":{"id":43642300,"uuid":"456105471","full_name":"meswapnilwagh/worldpedia","owner":"meswapnilwagh","description":"A simple but very useful NPM package to get all continents, subregions, countries, states and cities. ","archived":false,"fork":false,"pushed_at":"2022-02-26T06:48:36.000Z","size":3151,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-07T22:29:28.997Z","etag":null,"topics":["capital","city","continents","country","currency","flag","nodejs","npm","reactjs","state","subregion"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/worldpedia","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/meswapnilwagh.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}},"created_at":"2022-02-06T09:22:46.000Z","updated_at":"2022-03-22T07:09:42.000Z","dependencies_parsed_at":"2022-08-03T05:00:18.278Z","dependency_job_id":null,"html_url":"https://github.com/meswapnilwagh/worldpedia","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/meswapnilwagh/worldpedia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meswapnilwagh%2Fworldpedia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meswapnilwagh%2Fworldpedia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meswapnilwagh%2Fworldpedia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meswapnilwagh%2Fworldpedia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meswapnilwagh","download_url":"https://codeload.github.com/meswapnilwagh/worldpedia/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meswapnilwagh%2Fworldpedia/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32448371,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"ssl_error","status_checked_at":"2026-04-29T22:10:49.234Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["capital","city","continents","country","currency","flag","nodejs","npm","reactjs","state","subregion"],"created_at":"2025-05-31T02:08:51.780Z","updated_at":"2026-04-29T23:31:42.748Z","avatar_url":"https://github.com/meswapnilwagh.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌏 Worldpedia\n\n\u003e “Worldpedia” is javascript library that will give you access to data of Continents, Subregions, Country, States \u0026 Cities\n\u003e \n\n![image](https://user-images.githubusercontent.com/4816238/153756023-94f0dd8f-d286-403b-968a-078940d5cdf3.png)\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://img.shields.io/npm/dw/worldpedia?logo=npm\u0026style=for-the-badge\"/\u003e\n\u003cimg src=\"https://img.shields.io/npm/v/worldpedia?logo=npm\u0026style=for-the-badge\"/\u003e\n\u003cimg src=\"https://img.shields.io/github/issues/meswapnilwagh/worldpedia?logo=github\u0026style=for-the-badge\"/\u003e\n\n\u003c/p\u003e\n\n# ⛳ Features \n\n- Get a list of countries of specific continents\n- Get a list of states of countries \n- Get a list of cities of states\n- Get countries belonging to specific subregion\n\nFind project documentation [here](https://projects.meswapnilwagh.com/worldpedia/)\n\n# Demo \nDemo link [Worldpedia-Demo](https://worldpedia-demo.vercel.app/)\n\n# ⚙️ Install\n\n```\nnpm i worldpedia\n```\n\n# 🔭 Usage\n\n```jsx\nimport  { City, Continent, Country, State, Subregion } from 'worldpedia';\n```\n\n## Available modules\n\n1. Continent\n2. Subregion\n3. Country\n4. State\n5. City\n\n## Continent\n\nFollowing functions are available in the continent module\n\n### getAllContinents()\n\n---\n\nThis function returns all the available continents\n**Type:** `IContinent[ ]`\n\n**Output:**\n\n```jsx\n[\n    {\n        \"code\": \"AF\",\n        \"name\": \"Africa\"\n    },\n    {\n        \"code\": \"AN\",\n        \"name\": \"Antarctica\"\n    },\n    {\n        \"code\": \"AS\",\n        \"name\": \"Asia\"\n    },\n    {\n        \"code\": \"EU\",\n        \"name\": \"Europe\"\n    },\n    {\n        \"code\": \"NA\",\n        \"name\": \"North america\"\n    },\n    {\n        \"code\": \"OC\",\n        \"name\": \"Oceania\"\n    },\n    {\n\t\t    \"code\": \"SA\",\n        \"name\": \"South america\"\n    }\n]\n```\n\n### getContinentByCode(continentCode)\n\n---\n\nThis function accept `continentCode` as a parameter and return the single instance of `IContienent` matching with the parameter\n**Type:** `IContinent | undefined`\n\n**Output:**\n\n```jsx\n{\n\t\"code\": \"AS\",\n\t\"name\": \"Asia\"\n}\n\n```\n\n## Subregion\n\nFollowing function are available in the subregion module\n\n### getAllSubregion()\n\n---\n\nThis function returns all the subregions\n**Type:** `ISubregion[] | []`\n\n**Output:**\n\n```jsx\n[\n\t{\n\t\t\"name\":  \"Southern Asia\",\n\t\t\"continent\":  \"Asia\",\n\t\t\"continent_code\":  \"AS\"\n\t},\n\t{\n\t\t\"name\":  \"Northern Europe\",\n\t\t\"continent\":  \"Europe\",\n\t\t\"continent_code\":  \"EU\"\n\t},\n\t...\n]\n\n```\n\n### getAllSubregionByContinent(continentCode)\n\n---\n\nThis function accepts the `continentCode` as a parameter and returns the list of all subregions belonging to the `continentCode`\n\n**Type:** `ISubregions[] | []`\n\n**Output:**\n\n```jsx\n[\n    { \n        \"name\": \"Southern Asia\", \n        \"continent\": \"Asia\", \n        \"continent_code\": \"AS\" \n    },\n    { \n        \"name\": \"Western Asia\", \n        \"continent\": \"Asia\", \n        \"continent_code\": \"AS\" \n    },\n    {\n        \"name\": \"South-eastern Asia\",\n        \"continent\": \"Asia\",\n        \"continent_code\": \"AS\"\n    },\n    { \n        \"name\": \"Eastern Asia\", \n        \"continent\": \"Asia\", \n        \"continent_code\": \"AS\" \n    },\n    { \n        \"name\": \"Central Asia\", \n        \"continent\": \"Asia\", \n        \"continent_code\": \"AS\" \n    }\n]\n```\n\n## Country\n\nFollowing function are available in the country module\n\n### getAllCountries()\n\n---\n\nThis function returns all the countries\n\n**Type:** `ICountry[] | []`\n\n**Output:** \n\n```jsx\n[\n\t\t{\n        \"id\": 1,\n        \"name\": \"Afghanistan\",\n        \"iso3\": \"AFG\",\n        \"iso2\": \"AF\",\n        \"numeric_code\": \"004\",\n        \"phone_code\": \"93\",\n        \"capital\": \"Kabul\",\n        \"currency\": \"AFN\",\n        \"currency_name\": \"Afghan afghani\",\n        \"currency_symbol\": \"؋\",\n        \"tld\": \".af\",\n        \"native\": \"افغانستان\",\n        \"subregion\": \"Southern Asia\",\n        \"timezones\": [\n            {\n                \"zoneName\": \"Asia/Kabul\",\n                \"gmtOffset\": 16200,\n                \"gmtOffsetName\": \"UTC+04:30\",\n                \"abbreviation\": \"AFT\",\n                \"tzName\": \"Afghanistan Time\"\n            }\n        ],\n        \"translations\": {\n            \"kr\": \"아프가니스탄\",\n            \"br\": \"Afeganistão\",\n            \"pt\": \"Afeganistão\",\n            \"nl\": \"Afghanistan\",\n            \"hr\": \"Afganistan\",\n            \"fa\": \"افغانستان\",\n            \"de\": \"Afghanistan\",\n            \"es\": \"Afganistán\",\n            \"fr\": \"Afghanistan\",\n            \"ja\": \"アフガニスタン\",\n            \"it\": \"Afghanistan\",\n            \"cn\": \"阿富汗\"\n        },\n        \"latitude\": \"33.00000000\",\n        \"longitude\": \"65.00000000\",\n        \"emoji\": \"🇦🇫\",\n        \"emojiU\": \"U+1F1E6 U+1F1EB\",\n        \"continent\": \"Asia\",\n        \"continent_code\": \"AS\"\n    }\n\t\t...\n]\n```\n\n### getCountryByCode(code:string)\n\n---\n\nThis function accept country code as a parameter and return the single instance of `ICountry` matching with the parameter\n\n**Type:** `ICountry | undefined`\n\n**Output:** \n\n```jsx\n\n {\n    \"name\": \"India\",\n    \"iso3\": \"IND\",\n    \"iso2\": \"IN\",\n    \"numeric_code\": \"356\",\n    \"phone_code\": \"91\",\n    \"capital\": \"New Delhi\",\n    \"currency\": \"INR\",\n    \"currency_name\": \"Indian rupee\",\n    \"currency_symbol\": \"₹\",\n    \"tld\": \".in\",\n    \"native\": \"भारत\",\n    \"subregion\": \"Southern Asia\",\n    \"timezones\": [\n        {\n            \"zoneName\": \"Asia/Kolkata\",\n            \"gmtOffset\": 19800,\n            \"gmtOffsetName\": \"UTC+05:30\",\n            \"abbreviation\": \"IST\",\n            \"tzName\": \"Indian Standard Time\"\n        }\n    ],\n    \"translations\": {\n        \"kr\": \"인도\",\n        \"br\": \"Índia\",\n        \"pt\": \"Índia\",\n        \"nl\": \"India\",\n        \"hr\": \"Indija\",\n        \"fa\": \"هند\",\n        \"de\": \"Indien\",\n        \"es\": \"India\",\n        \"fr\": \"Inde\",\n        \"ja\": \"インド\",\n        \"it\": \"India\",\n        \"cn\": \"印度\"\n    },\n    \"latitude\": \"20.00000000\",\n    \"longitude\": \"77.00000000\",\n    \"emoji\": \"🇮🇳\",\n    \"emojiU\": \"U+1F1EE U+1F1F3\",\n    \"continent\": \"Asia\",\n    \"continent_code\": \"AS\"\n}\n```\n\n### getAllCountriesByContinent(continentCode: string)\n\n---\n\nThis function accept continent code as a parameter and return all countries of the continents\n\n**Type:** `ICountry[] | []`\n\n### getAllCountriesBySubregion(subregion: string)\n\n---\n\nThis function accept subregion name as a parameter and return all countries of the subregion\n\n**Type:** `ICountry[] | []`\n\n## State\n\nFollowing function are available in the state module\n\n### getAllStates()\n\n---\n\nThis function returns all the states\n\n**Type:** `IState[] | []`\n\n### getAllStatesByCountry(countryCode: string)\n\n---\n\nThis function accept country code as a parameter and return all states of the country\n\n**Type:** `IState[] | []`\n\n### getStateByCodeAndCountry(stateCode: string, countryCode: string)\n\n---\n\nThis function accept state iso code and country code as a parameter and return the single instance of the `IState`\n\n**Type:** `IState | undefined`\n\n**Output:**\n\n```jsx\n{\n    \"name\": \"Maharashtra\",\n    \"isoCode\": \"MH\",\n    \"countryCode\": \"IN\",\n    \"latitude\": \"19.75147980\",\n    \"longitude\": \"75.71388840\"\n}\n```\n\n## City\n\nFollowing function are available in the city module\n\n### getAllCities()\n\n---\n\nThis function returns all the cities\n\n**Type:** `ICity[] | []`\n\n### getAllCitiesOfState(stateCode: string, countryCode: string)\n\n---\n\nThis function accept state Code and country code as a parameter and return all cities of the states.\n\n**Type:** `ICity[] | []`\n\n### getAllCitiesByCountry(countryCode: string)\n\n---\n\nThis function accept country code as a parameter and return all cities of the country.\n\n**Type:** `ICity[] | []`\n\n**Output:**\n\n```jsx\n[\n  {\n    name: 'Achalpur',\n    countryCode: 'IN',\n    stateCode: 'MH',\n    latitude: '21.25665000',\n    longitude: '77.51006000'\n  },\n  {\n    name: 'Ahiri',\n    countryCode: 'IN',\n    stateCode: 'MH',\n    latitude: '19.41386000',\n    longitude: '80.00359000'\n  },\n  {\n    name: 'Ahmadnagar',\n    countryCode: 'IN',\n    stateCode: 'MH',\n    latitude: '19.09457000',\n    longitude: '74.73843000'\n  }\n\t...\n]\n```\n# ✍️ How to Contribute\n- Clone repo and create a new branch: $ git checkout https://github.com/meswapnilwagh/worldpedia -b branch-name.\n- Make changes and test\n- Submit Pull Request with comprehensive description of changes\n\n# 🗂️ Data Source\n\n - Thanks to [Darshan Gada](https://github.com/dr5hn) for [Country State City](https://github.com/dr5hn/countries-states-cities-database) data\n - Thanks to [Flagpedia](https://flagpedia.net/) for png flags of countries\n\n For any data related issue, you can raise a Issue [here](https://github.com/meswapnilwagh/worldpedia/issues).\n\n# 👨‍💻 Author\n### ``` Swapnil Abhimanyu Wagh ```\n\n\n\u003cp align=\"left\"\u003e\n\u003ca href=\"https://meswapnilwagh.com\" target=\"blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/Blog-meswapnilwagh.com-green?style=for-the-badge\u0026logo=hashnode\" alt=\"meswapnilwagh\" /\u003e\u003c/a\u003e \n\u003ca href=\"https://twitter.com/meswapnilwagh\" target=\"blank\"\u003e\u003cimg src=\"https://img.shields.io/twitter/follow/meswapnilwagh?logo=twitter\u0026style=for-the-badge\" alt=\"meswapnilwagh\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeswapnilwagh%2Fworldpedia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeswapnilwagh%2Fworldpedia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeswapnilwagh%2Fworldpedia/lists"}