Closed MichaelLiss closed 4 years ago
@MichaelLiss Sure. You can use the findOne()
method to that matter.
const countryCodes = require('country-codes-list')
// Find a country by a property and return the first match as an object
console.log(countryCodes.findOne('countryCode', 'US') )
This will be the output
{
countryNameEn: 'United States of America',
countryNameLocal: 'United States of America',
countryCode: 'US',
currencyCode: 'USD',
currencyNameEn: 'United States dollar',
tinType: '',
tinName: '',
officialLanguageCode: 'en',
officialLanguageNameEn: 'English',
officialLanguageNameLocal: 'English',
countryCallingCode: '1',
region: 'North America',
flag: '🇺🇸'
}
AWESOME ! Thank you
Hi,
I am new to node js programming and am trying to use your object:
I assume that customList returns a list... and I could do an indexOf that list... but it's not working...
Is there another way that I can get JUST the country code information for ONLY the country I am interested in ?