@menty44/phonecodelib
v9.0.0
Published
returns country's based of supplied parameters
Downloads
17
Maintainers
Readme
phonecodelib
A javascript library for returning a country's info based on supplied parameters
Table of Contents
Installing
Using npm:
$ npm i @menty44/phonecodelib
Example
note: CommonJS usage
In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with require()
use the following approach:
const countryInfo = require('@menty44/phonecodelib');
Example 1
Get By Phone Number
const countryInfo = require('@menty44/phonecodelib');
let info = countryInfo.getByPhoneNumber("2547XXXXXX");
console.log(info);
Example 2
Get By Country Code ISO
const countryInfo = require('@menty44/phonecodelib');
let info = countryInfo.getByCountryCode("Ke");
console.log(info);
Example 3
Get By Country Name
const countryInfo = require('@menty44/phonecodelib');
let info = countryInfo.getByCountryName("Kenya");
console.log(info);