📦 Installation

Get started with Countries Cities AR in your project. Choose your preferred package manager and follow the guide.

Quick Install

npm
npm install countries-cities-ar
yarn
yarn add countries-cities-ar
pnpm
pnpm add countries-cities-ar

Requirements

Node.js 16+
Required for all setups
TypeScript 5+
Optional, but recommended
React 18+
For React examples
Next.js 13+
For Next.js examples

Basic Usage

import { allCountries, getCountryByCode } from 'countries-cities-ar';

// Get all countries
console.log(allCountries.length); // 250

// Get a specific country
const egypt = getCountryByCode('EG');
console.log(egypt?.nameAr); // "مصر"
console.log(egypt?.cities.length); // 27

// Get Saudi Arabia
const saudi = getCountryByCode('SA');
console.log(saudi?.cities); // 13 regions with Arabic names

Framework Setup Guides

Verify Installation

After installation, verify that the library is working correctly:

test.js
// Create a test file: test.js
import { allCountries } from 'countries-cities-ar';

console.log('✅ Library loaded successfully!');
console.log(`📊 Total countries: ${allCountries.length}`);
console.log(`🌍 First country: ${allCountries[0].name}`);

// Run with:
// node test.js

Installation Issues?

If you encounter any issues during installation, check our troubleshooting guide.

View Troubleshooting Guide →

Next Steps

Countries Cities AR

Documentation

Version
v3.0.1
250 دولة • 4,642 محافظة