# lebanese-utils

> A collection of utility functions tailored for the Lebanese community.

Latest version **2.0.0** (published 2023-12-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install lebanese-utils
pnpm add lebanese-utils
yarn add lebanese-utils
bun add lebanese-utils
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2023-12-21 |
| First published | 2023-12-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 8.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Joe Eid |
| Maintainers | joeeid |
| Keywords | Lebanese-Utils, Lebanon-Utils, Lebanon, Lebanese, Utils |

## Links

- npm: https://www.npmjs.com/package/lebanese-utils
- Repository: https://github.com/Joeeid/Lebanese-Utils
- Homepage: https://github.com/Joeeid/Lebanese-Utils#readme
- Issues: https://github.com/Joeeid/Lebanese-Utils/issues
- npm.io page: https://npm.io/package/lebanese-utils

## Dependencies (3)

- [axios](https://npm.io/package/axios.md) ^1.6.2
- [cheerio](https://npm.io/package/cheerio.md) ^1.0.0-rc.12
- [date-fns](https://npm.io/package/date-fns.md) ^2.30.0

## Recent versions

- 2.0.0 (latest) — 2023-12-21
- 1.1.1 — 2023-12-15
- 1.1.0 — 2023-12-15
- 1.0.1 — 2023-12-13
- 1.0.0 — 2023-12-13

## README

# lebanese-utils

**lebanese-utils** is a Node.js package that provides a collection of utility functions tailored for the Lebanese community. It includes features such as Lebanese public holidays, currency rate conversion, and more. Feel free to use this package to integrate Lebanese functionalities into your Node.js projects.

## Requirements

This module requires:

- [Node.js](https://nodejs.org/)
- [date-fns](https://date-fns.org/)
- [axios](https://axios-http.com/)
- [cheerio](https://cheerio.js.org/)

## Installation ⚙

```bash
npm install lebanese-utils
```

## Usage 🛠

```javascript
import * as lebaneseUtils from "lebanese-utils";
```

## Available Functions ✨

```javascript
/***** Async Functions *****/
/*** Holiday Functions ***/

isHoliday(date: "dd-MM-yyyy"): boolean
//Check if a given date is a public holiday.
//Ex: console.log(await lebaneseUtils.isHoliday("01-01-2024"));
//output: true

getHolidaysNumber(year: number): number
//Get the number of all public holidays.

getHolidays(year: number): Array<Object>
//Get a list of all public holidays.


/*** USD/LBP Rate Conversion Functions ***/

getMarketRate(): number
//Get the latest Market USD/LBP Rate.

convertToLBP(amount: number): number
//Convert an amount in USD to LBP.

convertToUSD(amount: number): number
//Convert an amount in LBP to USD.


/***** Sync Functions *****/
/*** Lebanese Numbers Functions ***/

getAreaCode(number: "99999999"): string
//Get the area code of lebanese numbers

isAlfa(number: "99999999"): boolean
//Check if a number is Alfa

isTouch(number: "99999999"): boolean
//Check if a number is Touch
```

## Contributing ❤️

Contributions are welcome! If you have ideas for new features or improvements, feel free to open an issue or submit a pull request.

---
_Source: https://npm.io/package/lebanese-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
