Package Exports
- is-valid-phone-tr
- is-valid-phone-tr/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (is-valid-phone-tr) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
๐ฑ is-valid-phone-tr
Validate Turkish mobile phone numbers with ease.
This package checks whether a given string is a valid Turkish GSM number. Supports common formats like +90
, 05
, or just 5
.
๐ฆ Installation
Using npm
npm install is-valid-phone-tr
Using yarn
yarn add is-valid-phone-tr
๐ Usage
const isValidPhone = require("is-valid-phone-tr");
console.log(isValidPhone("05551234567")); // true
console.log(isValidPhone("+905551234567")); // true
console.log(isValidPhone("5551234567")); // true
console.log(isValidPhone("123456")); // false
โ๏ธ Options
There are no configuration options.
Format Supported | Example |
---|---|
With country code | +905551234567 |
With zero prefix | 05551234567 |
Without prefix | 5551234567 |
With spaces/dashes | 0555 123 45 67 / 0555-123-4567 |
๐งพ How It Works
It uses a regular expression to validate Turkish GSM numbers (5xx
area codes) and allows optional country prefix (+90
, 0
).
๐งช Run Test
node test.js
๐ชช License
MIT