0.1.1 • Published 2 years ago

country_by_phone v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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