Installations
npm install country-emoji
Developer Guide
Typescript
Yes
Module System
CommonJS
Node Version
12.21.0
NPM Version
6.14.11
Score
91
Supply Chain
100
Quality
78.5
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
Download Statistics
Total Downloads
1,571,371
Last Day
2,472
Last Week
9,757
Last Month
42,630
Last Year
434,248
GitHub Statistics
86 Stars
154 Commits
25 Forks
4 Watching
6 Branches
13 Contributors
Bundle Size
11.02 kB
Minified
4.46 kB
Minified + Gzipped
Package Meta Information
Latest Version
1.5.6
Package Id
country-emoji@1.5.6
Size
8.66 kB
NPM Version
6.14.11
Node Version
12.21.0
Publised On
21 Mar 2021
Total Downloads
Cumulative downloads
Total Downloads
1,571,371
Last day
7.2%
2,472
Compared to previous day
Last week
-15.8%
9,757
Compared to previous week
Last month
15.9%
42,630
Compared to previous month
Last year
17.3%
434,248
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
7
country-emoji
Converts between country names, ISO 3166-1 codes and flag emojis. Has zero dependencies.
Install
$ npm install --save country-emoji
Usage
1const {flag, code, name, countries} = require('country-emoji'); 2 3flag('CL') 4 // ~> ???????? 5 6code('????????') 7 // ~> CA 8 9name('????????') 10 // ~> Qatar 11 12// can extract name from string… 13flag('Taiwan number one!') 14 // ~> ???????? 15 16// …but only if there's no ambiguity 17flag('Congo and Burma') 18 // ~> undefined 19 20flag('Republic of Tanzania') 21 // ~> ???????? 22 23flag('Tanzania, United Republic of') 24 // ~> ???????? 25 26code('Australia') 27 // ~> AU 28 29code('UAE') 30 // ~> AE 31 32name('AE') 33 // ~> United Arab Emirates 34 35code('UK') 36 // ~> GB 37 38// all values can be converted back and forth indefinitely 39flag(name(flag(code(flag(name('NZ')))))) 40 // ~> ???????? 41 42 // a dictionary (of country code to country name) of all countries 43Object.keys(countries).join(", ") 44 // ~> AD, AE, AF, AG, AI, AL, AM, AN, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BM, BN, BO, BR, BS, BT, BV, BW, BY, BZ, CA, CC, CD, CF, CG, CH, CI, CK, CL, CM, CN, CO, CR, CU, CV, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, ET, EU, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IQ, IR, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KP, KR, KW, KY, KZ, LA, LB, LC, LI, LK, LR, LS, LT, LU, LV, LY, MA, MC, MD, ME, MG, MH, MK, ML, MM, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NI, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PS, PT, PW, PY, QA, RE, RO, RS, RU, RW, SA, SB, SC, SD, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SR, ST, SV, SY, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TR, TT, TV, TW, TZ, UA, UG, UM, US, UY, UZ, VA, VC, VE, VG, VI, VN, VU, WF, WS, XK, YE, YT, ZA, ZM, ZW 45
Don't want JS?
Check out the following:
- Swift: SwiftFlags (ref: #16)
- Rust: country-emoji [crates.io] (ref: #20)
PS. Happy to add more here :).
Bugs and feedback
If you discover a bug please report it here. Express gratitude here.
Mail me at bugs@meedamian.com, or on twitter @meeDamian.
License
MIT @ Damian Mee
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
packaging workflow detected
Details
- Info: Project packages its releases by way of GitHub Actions.: .github/workflows/node.js.yml:37
Reason
1 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/meeDamian/country-emoji/node.js.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/meeDamian/country-emoji/node.js.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/node.js.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/meeDamian/country-emoji/node.js.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/node.js.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/meeDamian/country-emoji/node.js.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/meeDamian/country-emoji/node.js.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/meeDamian/country-emoji/node.js.yml/master?enable=pin
- Info: 0 out of 4 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 2 third-party GitHubAction dependencies pinned
- Info: 2 out of 2 npmCommand dependencies pinned
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/8 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/node.js.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 23 are checked with a SAST tool
Score
4
/10
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 MoreOther packages similar to country-emoji
country-code-emoji
convert country codes (ISO 3166-1 alpha-2) to corresponding emoji flags (unicode regional indicator symbols)
country-flag-emoji-polyfill
Add country flag emojis to Chromium-based browsers on Windows
react-country-flag
> React component for emoji/svg country flags.
country-locale-map
Provides mapping between country codes and provides default country locales. Includes optional fuzzy matching for country name.