📦 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-aryarn
yarn add countries-cities-arpnpm
pnpm add countries-cities-arRequirements
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 namesFramework Setup Guides
⚡
Next.js Setup
Step-by-step guide for Next.js 13+ App Router with Server and Client Components
Read Guide →
⚛️
React + Vite Setup
Quick setup guide for React with Vite, create-react-app, or any React setup
Read Guide →
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.jsInstallation Issues?
If you encounter any issues during installation, check our troubleshooting guide.
View Troubleshooting Guide →