npm.io
9.0.0 • Published 5 years ago

@menty44/phonecodelib

Licence
MIT
Version
9.0.0
Deps
0
Size
59 kB
Vulns
0
Weekly
0

phonecodelib

GitHub issues Ask Me Anything ! Documentation Status GitHub license GitHub release GitHub stars GitHub forksforthebadge

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);

Keywords