area-codes-uk

Search for UK dialling codes in JavaScript

Usage no npm install needed!

<script type="module">
  import areaCodesUk from 'https://cdn.skypack.dev/area-codes-uk';
</script>

README

UK geographic area codes

Build Status

A dataset with over 700 dialling codes of the United Kingdom, which comes with a simple function to look up areas by phone number.

Installation

With NPM:

npm install area-codes-uk --save

Usage

Supports multiple prefixes and ignores suffixes. Examples:

var areaCodes = require('area-codes-uk');
areaCodes.lookupUK('01619999999'); // Manchester
areaCodes.lookupUK('+442099999999'); // London
areaCodes.lookupUK('00441890399999'); // Coldstream
areaCodes.lookupUK('01624999999@examplesipprovider.com'); // Isle of Man

If no matching area can be found, the function will return null.

Data source

List of UK area codes: © Ofcom copyright 2006-11