country_by_phone

0.1.1 • Public • Published

Get country info by phone number

Usage

import cbp from 'country_by_phone'; // All
import {
  getLocation,
} from 'country_by_phone';          // Separate

console.log(cbp.getIso2('+7705311'));
// KZ

console.log(getLocation('+7705311'));
// Kazakhstan

Remarks

  • Full length of the phone number is not required. Five digits are enough
  • Possible phone formats (equivalent):
    • xxxxx
    • +xxxxx
    • 00xxxxx
  • require not supported yet

Package Sidebar

Install

npm i country_by_phone

Weekly Downloads

2

Version

0.1.1

License

MIT

Unpacked Size

49.4 kB

Total Files

10

Last publish

Collaborators

  • axsmak