Gathering detailed insights and metrics for country-locale-map
Gathering detailed insights and metrics for country-locale-map
Gathering detailed insights and metrics for country-locale-map
Gathering detailed insights and metrics for country-locale-map
npm install country-locale-map
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
46 Stars
244 Commits
44 Forks
2 Watchers
2 Branches
18 Contributors
Updated on Apr 24, 2025
Latest Version
1.9.9
Package Id
country-locale-map@1.9.9
Unpacked Size
221.63 kB
Size
42.67 kB
File Count
10
NPM Version
10.8.1
Node Version
22.3.0
Published on
Nov 19, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
6
Provides easy conversion between country codes and names as well as a default locale for each country. Includes fuzzy matching for country name lookups. Methods return undefined if no matches are found
1const clm = require('country-locale-map'); 2clm.getAlpha3ByAlpha2('CA'); //returns 'CAN'
If you would like locales to be returned with - instead of_ you can set an environment variable
CLM_MODE='INTL' in a .env file using dotenv just make sure that dotenv is required before requiring the country local map library
1clm.getAlpha3ByAlpha2('CA'); //returns 'CAN'
1clm.getLocaleByAlpha2('CA'); //returns 'en_CA'
1clm.getCountryNameByAlpha2('CA'); //returns 'Canada'
1clm.getNumericByAlpha2('CA'); //returns '124'
1clm.getCurrencyByAlpha2('CA'); //returns 'CAD'
1clm.getCountryByAlpha2('CA'); 2 3/*returns 4 5 { 6 "name":"Canada", 7 "alpha2":"CA", 8 "alpha3":"CAN", 9 "numeric":"124", 10 "locales":["en_CA","fr_CA"], 11 "default_locale":"en_CA", 12 "currency":"CAD", 13 "languages":["en","fr"], 14 "capital":"Ottawa", 15 "emoji":"🇨🇦", 16 "emojiU":"U+1F1E8 U+1F1E6", 17 "fips":"CA", 18 "internet":"CA", 19 "continent":"Americas", 20 "region":"North America" 21 } 22 23*/
1clm.getAlpha3ByAlpha2('CAN'); //returns 'CA'
1clm.getLocaleByAlpha3('CAN'); //returns 'en_CA'
1clm.getCountryNameByAlpha3('CAN'); //returns 'Canada'
1clm.getNumericByAlpha3('CAN'); //returns '124'
1clm.getCurrencyByAlpha3('CAN'); //returns 'CAD'
1clm.getCountryByAlpha3('CAN'); 2 3 4/*returns 5 6 { 7 "name":"Canada", 8 "alpha2":"CA", 9 "alpha3":"CAN", 10 "numeric":"124", 11 "locales":["en_CA","fr_CA"], 12 "default_locale":"en_CA", 13 "currency":"CAD", 14 "languages":["en","fr"], 15 "capital":"Ottawa", 16 "emoji":"🇨🇦", 17 "emojiU":"U+1F1E8 U+1F1E6", 18 "fips":"CA", 19 "internet":"CA", 20 "continent":"Americas", 21 "region":"North America" 22 } 23 24*/ 25
1clm.getAlpha2ByNumeric('123'); //returns 'CA'
1clm.getAlpha3ByNumeric('124'); //returns 'CAN'
1clm.getLocaleByNumeric('124'); //returns 'en_CA'
1clm.getCountryNameByNumeric('124'); //returns 'Canada'
1clm.getCurrencyByNumeric('124'); //returns 'CAD'
1clm.getCountryByNumeric('124'); 2 3 4/*returns 5 6 { 7 "name":"Canada", 8 "alpha2":"CA", 9 "alpha3":"CAN", 10 "numeric":"124", 11 "locales":["en_CA","fr_CA"], 12 "default_locale":"en_CA", 13 "currency":"CAD", 14 "languages":["en","fr"], 15 "capital":"Ottawa", 16 "emoji":"🇨🇦", 17 "emojiU":"U+1F1E8 U+1F1E6", 18 "fips":"CA", 19 "internet":"CA", 20 "continent":"Americas", 21 "region":"North America" 22 } 23 24*/ 25 26
1clm.getAlpha2ByName('Canada'); //returns 'CA'
1clm.getAlpha3ByName('Canada'); //returns 'CAN'
1clm.getLocaleByName('Canada'); //returns 'en_CA'
1clm.getNumericByName('Canada'); //returns '124'
1clm.getCurrencyByName('Canada'); //returns 'CAD'
1clm.getCountryByName('Canada'); 2 3/*returns 4 5 { 6 "name":"Canada", 7 "alpha2":"CA", 8 "alpha3":"CAN", 9 "numeric":"124", 10 "locales":["en_CA","fr_CA"], 11 "default_locale":"en_CA", 12 "currency":"CAD", 13 "languages":["en","fr"], 14 "capital":"Ottawa", 15 "emoji":"🇨🇦", 16 "emojiU":"U+1F1E8 U+1F1E6", 17 "fips":"CA", 18 "internet":"CA", 19 "continent":"Americas", 20 "region":"North America" 21 } 22 23*/ 24
if true is passed for fuzzy these functions will do a fuzzy match if it can't find an exact match eg:
1clm.getCountryByName('Candaa', true); 2 3/*returns 4 5 { 6 "name":"Canada", 7 "alpha2":"CA", 8 "alpha3":"CAN", 9 "numeric":"124", 10 "locales":["en_CA","fr_CA"], 11 "default_locale":"en_CA", 12 "currency":"CAD", 13 "languages":["en","fr"], 14 "capital":"Ottawa", 15 "emoji":"🇨🇦", 16 "emojiU":"U+1F1E8 U+1F1E6", 17 "fips":"CA", 18 "internet":"CA", 19 "continent":"Americas", 20 "region":"North America" 21 } 22 23*/ 24
1clm.getAllCountries(); 2 3/*returns 4 the list of all countries 5*/ 6
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
4 existing vulnerabilities detected
Details
Reason
Found 4/24 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More