🌎
country-info
  • Welcome!
  • Quick Start
  • Changelog
  • Reference
    • Functions
      • Get Continent Information
      • Get Country Information
      • Get All Countries Information
      • Get Country by Top-Level Domain
      • Search Countries
    • Function Signatures
    • Testing
Powered by GitBook
On this page

Was this helpful?

  1. Reference
  2. Functions

Get Continent Information

You can use the getContinent function to obtain information about countries in a specific continent. This function takes the continent name as input and optionally an array of specific fields to retrieve.

const { getContinent } = require('countrys-info');

// Get information about countries in a specific continent
const africaCountries = getContinent('Africa');
console.log(africaCountries);

// Get specific fields of countries in a continent
const africaFields = getContinent('Africa', ['capital_en', 'code_2', 'tld']);
console.log(africaFields);
PreviousFunctionsNextGet Country Information

Last updated 1 year ago

Was this helpful?