Azerbaijan-specific utility functions for Node.js backends
!pipeline status
!npm version
!license
A lightweight, TypeScript-first utility library providing Azerbaijan-specific helpers commonly needed in backend development.
This package focuses on validation, normalization, and parsing of data formats frequently used in Azerbaijan-based systems.
> Initial release focuses on Azerbaijan mobile phone utilities
> Added support for FIN and local ID utilities
---
- Validate Azerbaijan mobile phone numbers
- Normalize phone numbers to a standard local format
- Detect mobile operator (Azercell, Bakcell, Nar)
- Validate FIN
- Normalize FIN
- Validate local ID series
- Normalize ID series
- Supported series (AZE,AA,AB)
More utilities (IBAN, addresses) will be added incrementally.
---
``bash
npm install @caucasus/az-utils
`
`
import {
isValidAzPhone,
normalizeAzPhone,
getAzMobileOperator,
IsAzPhone,
TransformAzPhone
...etc
} from "az-utils";
`
``
isValidAzPhone("+994 (50) 123-45-67"); // true
isValidAzPhone("0501234567"); // true
isValidAzPhone("0401234567"); // false
Supported input formats:
- 0501234567
- 050 123 45 67
- (050) 123-45-67
- 994501234567
- +994501234567
`
normalizeAzPhone("+994701112233");
// "0701112233"
normalizeAzPhone("(050) 123-45-67");
// "0501234567"
`
`
getAzMobileOperator("0501234567");
// "Azercell"
getAzMobileOperator("0551234567");
// "Bakcell"
getAzMobileOperator("0771234567");
// "Nar"
`
`
class TestDto {
@IsAzPhone()
phone!: string;
@IsFin()
fin!: string
@IsSeries()
idSeries!: string
}
``
| Prefix | Operator |
| ------------ | -------- |
| 050, 051,010 | Azercell |
| 055, 099 | Bakcell |
| 070, 077 | Nar |
AZE, AA, AB
---
Planned additions:
- Azerbaijan IBAN validation
- Address parsing utilities
- Localization helpers (AZ / EN / RU)
Contributions are welcome.
Please:
- Keep changes small and focused
- Add tests for new functionality
- Avoid breaking changes without discussion
MIT License Β© Contributors
---