Socket
Socket
Sign inDemoInstall

phone-validator-net

Package Overview
Dependencies
3
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    phone-validator-net

A wrapper for the phone-validator.net API


Version published
Weekly downloads
7
increased by75%
Maintainers
2
Install size
435 kB
Created
Weekly downloads
 

Readme

Source

phone-validator-net

A small library providing a wrapper for api.phone-validator.net

Installation

npm install phone-validator-net

Usage

import PhoneValidator from 'phone-validator-net'

// YOUR_API_KEY is a string
const validatorInstance = PhoneValidator(YOUR_API_KEY)

const responseObject = await validatorInstance(phoneObject) //validates phone object
//phone is an object like
// {
//   number: "+49173xxxxxxxxx",  //phone number to validate (string) | 0173xxxxxxx also possible with country code
//   countrycode: "de",        //two letter ISO 3166-1 country code (string) [optional]
//   mode: "extensive"           //'extensive' | 'express' (string) [optional; default 'extensive']
// }

/*
  responseObject looks like this:
  {
    status	              VALID_CONFIRMED, VALID_UNCONFIRMED, INVALID or error: DELAYED, RATE_LIMIT_EXCEEDED, API_KEY_INVALID_OR_DEPLETED
    linetype	            FIXED_LINE, MOBILE, VOIP, TOLL_FREE, PREMIUM_RATE, SHARED_COST, PERSONAL_NUMBER, PAGER, UAN, VOICEMAIL
    location	            geographical location (city, county, state)
    countrycode	          two letter ISO 3166-1 country code
    formatnational	      phone number in national format
    formatinternational	  phone number in international format
  }

  => https://www.phone-validator.net/api.html
*/
});

Tests

npm test

Release History

  • 2.0.0 Rewrite in Typescript and using Promises
  • 0.1.0 Initial release

Keywords

FAQs

Last updated on 17 Oct 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc