A comprehensive Node.js package for validating Somali National ID cards with enhanced date formats, trilingual support (English/Somali/Arabic), interactive CLI, and performance optimizations.
# 🇸🇴 Somali ID Validator v0.2.0
A comprehensive Node.js package for validating Somali National ID cards with enhanced date formats, trilingual support (English/Somali/Arabic), interactive CLI, and performance optimizations.
## ✨ Features
- 🔍 **Complete ID Validation** - Validates ID number, name, gender, and dates
- 🌍 **Trilingual Support** - Error messages in English, Somali (Af-Soomaali), and Arabic (العربية)
- 📅 **Enhanced Date Formats** - Supports dd-mm-yyyy, dd/mm/yyyy, yyyy-mm-dd, dd.mm.yyyy
- 🔒 **Privacy Protection** - Built-in masking and redaction functions
- ⚡ **Interactive CLI** - Command-line interface with interactive mode and batch processing
- 🚀 **Performance Optimized** - Fast validation with caching and batch processing
- 📝 **TypeScript Support** - Full type definitions included
- 🛡️ **Configurable Rules** - Customizable validation rules
- 🎯 **Zero Dependencies** - Lightweight and secure
## 📦 Installation
```bash
npm install somali-id-validator
```
For global CLI usage:
```bash
npm install -g somali-id-validator
```
## 🚀 Quick Start
### Basic Usage
```javascript
const ID = require('somali-id-validator');
// Validate a complete ID record
const result = ID.validateRecord({
idNumber: '934265782412',
name: 'Ahmed Hassan Mohamed',
sex: 'Male',
dobDMY: '15-03-1990', // Date of Birth (dd-mm-yyyy)
issueDMY: '01-01-2020', // Issue Date (dd-mm-yyyy)
expiryDMY: '01-01-2030' // Expiry Date (dd-mm-yyyy)
});
console.log(result);
// Output: { ok: true, idNumber: '934265782412', name: 'Ahmed Hassan Mohamed', ... }
```
### Enhanced Date Format Support (v0.2.0)
```javascript
// Multiple date formats supported
const result = ID.validateRecord({
idNumber: '934265782412',
name: 'Ahmed Hassan Mohamed',
sex: 'Male',
dobDMY: '1990-03-15', // yyyy-mm-dd format
issueDMY: '01/01/2020', // dd/mm/yyyy format
expiryDMY: '01.01.2030' // dd.mm.yyyy format
});
```
### Trilingual Error Messages (v0.2.0)
```javascript
try {
ID.validateRecord …