Giter Site home page Giter Site logo

byteplant / phone-validator-net Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 355 KB

NodeJS wrapper for the phone-validator.net API

Home Page: https://www.phone-validator.net/api.html

TypeScript 100.00%
phone-validation phone validation byteplant phone-number phonenumber phone-number-verification phone-marketing cleaning cleaning-data

phone-validator-net's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.