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
5,007,461
Last Day
4,923
Last Week
21,784
Last Month
96,130
Last Year
2,287,516
45 Stars
242 Commits
43 Forks
3 Watching
1 Branches
17 Contributors
Minified
Minified + Gzipped
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
Publised On
19 Nov 2024
Cumulative downloads
Total Downloads
Last day
-4.6%
4,923
Compared to previous day
Last week
-14.3%
21,784
Compared to previous week
Last month
4%
96,130
Compared to previous month
Last year
13%
2,287,516
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
2 existing vulnerabilities detected
Details
Reason
Found 4/24 approved changesets -- score normalized to 1
Reason
2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1
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-01-27
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