🌴 degache.js
Tunisian Developer's Essential Utility Library
Features
🆔
CIN Validation
Validate Tunisian National ID cards with ease
import { validateCIN } from 'degachejs';
// Simple validation
const isValid = validateCIN('12345678');
📱
Phone Numbers
Validate, format and get carrier info for Tunisian phone numbers
import { validatePhoneNumber, formatPhoneNumber } from 'degachejs';
// Validate phone number
const isValid = validatePhoneNumber('20123456');
// Format phone number
const formatted = formatPhoneNumber('20123456');
// +216 20 123 456
💼
Tax ID
Validate Tunisian Tax ID (Matricule Fiscal)
import { validateTaxID } from 'degachejs';
const isValid = validateTaxID('1234567A/P/M/000');
💰
Currency Formatting
Format currency in Tunisian style
import { formatCurrency } from 'degachejs';
const amount = formatCurrency(1234.56);
// 1.234,560 دينار تونسي
🏦
Bank Account (RIB)
Validate RIB and get bank information
import { validateRIB, getBankFromRIB } from 'degachejs';
// Validate RIB
const isValid = validateRIB('12345678901234567890');
// Get bank information
const bank = getBankFromRIB('12345678901234567890');
📋
Useful Constants
Access lists of Tunisian banks, carriers, and governorates
import { BANKS, CARRIERS, GOVERNORATES } from 'degachejs';
// Access list of Tunisian banks
console.log(BANKS);
// Access list of mobile carriers
console.log(CARRIERS);
Installation
npm install degachejs
# or
yarn add degachejs
# or
pnpm add degachejs
Why degache.js? 🤔
Tired of rewriting validation code for Tunisian CIN, phone numbers, and tax IDs? degache.js is your go-to utility library for all things Tunisian!
Named after the beautiful oasis city of Degache, this library brings the same refreshing relief to your development workflow.
✅ Production Ready
- Comprehensive input validation
- Optimized performance
- High test coverage
- Type-safe APIs
🛠️ Developer Friendly
- Detailed documentation
- TypeScript support
- Intuitive API design
- Minimal dependencies