markdown
# Ethiopian Calendar Converter 🇪🇹
A lightweight and accurate JavaScript/TypeScript library to convert dates between the **Gregorian** and **Ethiopian** calendar systems. It handles leap years and the unique 13th month (*Pagumē*) of the Ethiopian calendar.
---
## 📦 Installation
Install using your preferred package manager.
Using **npm** or **yarn**:
## npm
```bash
npm install ethiopian-calendar-new
```
## yarn
```bash
yarn add ethiopian-calendar-new
```
## 🚀 Usage
Importing
You can use either ES Modules or CommonJS:
ES Modules (recommended):
## short snippet
```jsx
import { toGregorian, toEthiopian } from 'ethiopian-calendar-new';
// Ethiopian to Gregorian
console.log(toGregorian(2017, 11, 19));
// ➜ { year: 2025, month: 7, day: 26 }
// Gregorian to Ethiopian
console.log(toEthiopian(2025, 7, 26));
// ➜ { year: 2017, month: 11, day: 19 }
```
## import and CommonJS require syntax
CommonJS (Node.js):
```jsx
const { toGregorian, toEthiopian } = require('ethiopian-calendar-new');
🔄 Convert Ethiopian → Gregorian
const ethiopianDate = { year: 2017, month: 1, day: 1 };
const gregorian = toGregorian(ethiopianDate.year, ethiopianDate.month, ethiopianDate.day);
console.log(gregorian); // { year: 2024, month: 9, day: 11 }
```
## 📘 API
```jsx
toGregorian(year, month, day) → converts Ethiopian → Gregorian
toEthiopian(year, month, day) → converts Gregorian → Ethiopian
```
🙏 Acknowledgments
Calculations based on the Ethiopian calendar system.