A dataset with over 700 dialling codes of the United Kingdom, which comes with a simple function to look up areas by phone number.
With NPM:
npm install area-codes-uk --save
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('[email protected]'); // Isle of Man
If no matching area can be found, the function will return null
.
List of UK area codes: © Ofcom copyright 2006-11