1.0.10 • Published 8 years ago

phonelib v1.0.10

Weekly downloads
18
License
MIT
Repository
github
Last release
8 years ago

npm version build status Test Coverage Code Climate

phonelib

Simple phonelib validator

Quick Start

Install it with NPM or add it to your package.json:

$ npm install phonelib

Then:

var phonelib = require('phonelib');

var phoneNumber = {
  phone: '2024561414',
  country: 'US'
}

phonelib.isValid(phoneNumber, function(err, result){
  console.log(result);
  //result ==> { phone: '2024561414', country: 'US', 'international: '+1 202-456-1414', isValid: true, numberType: 2}

  /*You can see the full numberType list on lib/phonelibtype.js
    it uses the same Google list. */

});

Tests

npm test

Licenses

This package is licensed under MIT.

Change log

1.0.10

  • parse phone to string before
1.0.10

8 years ago

1.0.9

9 years ago

1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago