@menty44/phonecodelib

9.0.0 • Public • Published

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

Package Sidebar

Install

npm i @menty44/phonecodelib

Weekly Downloads

6

Version

9.0.0

License

MIT

Unpacked Size

60.3 kB

Total Files

11

Last publish

Collaborators

  • menty44