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 β¦