JSPM

is-valid-phone-tr

1.0.1
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 1
    • Score
      100M100P100Q25262F
    • License MIT

    Validator for Turkish mobile phone numbers

    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