# n8n-nodes-israeli-phone

[![npm version](https://badge.fury.io/js/n8n-nodes-israeli-phone.svg)](https://badge.fury.io/js/n8n-nodes-israeli-phone)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

An n8n community node for formatting Israeli phone numbers into all possible variants.

## Installation

Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.

### npm

```bash
npm install n8n-nodes-israeli-phone
```

### n8n

1. Go to **Settings > Community Nodes**
2. Select **Install**
3. Enter `n8n-nodes-israeli-phone`
4. Select **Install**

## Usage

This node takes an Israeli phone number in any format and returns all possible formatting variants:

### Input

- **Phone Number**: Any Israeli phone number format (e.g., `050-123-4567`, `+972501234567`, `0501234567`)

### Output

Returns a JSON object with all possible phone number formats:

```json
{
	"original": "050-123-4567",
	"cleanedDigits": "0501234567",
	"local": "0501234567",
	"withPlus972": "+972501234567",
	"with972": "972501234567",
	"dashed": "050-123-4567",
	"spaced": "050 123 4567",
	"dotted": "050.123.4567",
	"internationalDashed": "+972-50-123-4567",
	"internationalSpaced": "+972 50 123 4567"
}
```

### Supported Formats

The node accepts Israeli phone numbers in various formats:

- `050-123-4567` (dashed)
- `050 123 4567` (spaced)
- `050.123.4567` (dotted)
- `0501234567` (local)
- `+972501234567` (international with plus)
- `972501234567` (international without plus)
- `00972501234567` (international with 00 prefix)

### Features

- ✅ Validates Israeli mobile phone numbers (05X-XXX-XXXX format)
- ✅ Handles international prefixes (+972, 972, 00972)
- ✅ Cleans and normalizes input
- ✅ Returns all common formatting variants
- ✅ Preserves original input for reference

## Examples

### Basic Usage

Input: `050-123-4567`
Output: All formatting variants as shown above

### International Number

Input: `+972501234567`
Output: Same variants, with `original` field showing the input format

### Invalid Numbers

Input: `123-456-7890`
Output: Empty object `{}` (non-Israeli number)

## Development

### Prerequisites

- Node.js 20.15+
- npm

### Setup

```bash
git clone https://github.com/EladAmraniAI/n8n-nodes-israeli-phone.git
cd n8n-nodes-israeli-phone
npm install
```

### Build

```bash
npm run build
```

### Lint

```bash
npm run lint
```

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## Support

If you encounter any issues or have questions, please file an issue on the [GitHub repository](https://github.com/EladAmraniAI/n8n-nodes-israeli-phone/issues).

## Author

**Elad Amrani**

- Email: elad@builddiz.com
- GitHub: [@EladAmraniAI](https://github.com/EladAmraniAI)
