Installations
npm install @paskalov-aris/countries-list
Developer Guide
Typescript
Yes
Module System
CommonJS
Node Version
16.16.0
NPM Version
8.19.3
Releases
Improve `getCountryCode()`
Published on 31 Jul 2024
Update data & types (new `partOf`, `userAssigned` params for countries)
Published on 04 Mar 2024
v3.0.6
Published on 20 Oct 2023
v3.0.5
Published on 29 Sept 2023
v3.0.1
Published on 29 Sept 2023
v3.0: ESM, TypeScript, Turborepo and country data updates
Published on 12 Sept 2023
Contributors
Unable to fetch Contributors
Languages
TypeScript (97.75%)
PHP (2.17%)
Shell (0.07%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
Download Statistics
Total Downloads
232
Last Day
1
Last Week
2
Last Month
7
Last Year
104
GitHub Statistics
1,213 Stars
206 Commits
432 Forks
18 Watching
2 Branches
14 Contributors
Bundle Size
44.54 kB
Minified
12.40 kB
Minified + Gzipped
Package Meta Information
Latest Version
5.0.0
Package Id
@paskalov-aris/countries-list@5.0.0
Unpacked Size
204.11 kB
Size
64.94 kB
File Count
45
NPM Version
8.19.3
Node Version
16.16.0
Publised On
17 Jan 2023
Total Downloads
Cumulative downloads
Total Downloads
232
Last day
0%
1
Compared to previous day
Last week
-33.3%
2
Compared to previous week
Last month
133.3%
7
Compared to previous month
Last year
-18.8%
104
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
28
Countries, Languages & Continents data
Continents & countries: ISO 3166-1 alpha-2 code (with alpha-2 to alpha-3 set), name, ISO 639-1 languages, capital and ISO 4217 currency codes, native name, calling codes. Lists are available in JSON, CSV and SQL formats. Also, contains separate JSON files with additional country Emoji flags data.
Version 2.0: Breaking changes
This version changes a lot in the data structures, and placement of the files.
So, if your projects depend on the old structure — specify previous versions, <2.0.0
.
Installation
Package is available via:
- NPM
npm install countries-list
- Composer / Packagist
composer require annexare/countries-list
- Bower
bower install countries
Usage
Module exports continents
, countries
, languages
, languagesAll
and functions:
getEmojiFlag(countryCode)
, wherecountryCode
is alpha-2String
getUnicode(emoji)
, whereemoji
is alpha-2 emoji flagString
Built files are in the ./dist
directory.
The ./data
directory contains source data.
The consistent data is available from ./dist/data.*
files (JSON, SQL).
Note: ES5 UMD build is here: ./dist/index.es5.min.js
.
Note: Country item languages
field is an Array
in JSON files to easily count and match items with a Language item.
But currency
and phone
calling codes may be a comma-separated String
.
Note: Languages list only contains languages used in Countries data. Full list of known languages is exported as languagesAll
from ./dist/languages.all.json
.
Data example
{
"continents": {
"AF": "Africa",
"AN": "Antarctica",
"AS": "Asia",
"EU": "Europe",
"NA": "North America",
"OC": "Oceania",
"SA": "South America"
},
"countries": {
"AE": {
"name": "United Arab Emirates",
"native": "دولة الإمارات العربية المتحدة",
"phone": "971",
"continent": "AS",
"capital": "Abu Dhabi",
"currency": "AED",
"languages": [
"ar"
],
"emoji": "🇦🇪",
"emojiU": "U+1F1E6 U+1F1EA"
},
...
"UA": {
"name": "Ukraine",
"native": "Україна",
"phone": "380",
"continent": "EU",
"capital": "Kyiv",
"currency": "UAH",
"languages": [
"uk"
],
"emoji": "🇺🇦",
"emojiU": "U+1F1FA U+1F1E6"
}
},
"languages": {
"ar": {
"name": "Arabic",
"native": "العربية",
"rtl": 1
},
...
"uk": {
"name": "Ukrainian",
"native": "Українська"
}
}
}
Contributing
Everything is generated from files in ./data/
, including SQL file.
Everything in ./dist/
is generated,
so please make data related changes ONLY to files from ./data/
, commit them.
Use npm run build
command to build/test generated files.
Credits
Prepared by Annexare Studio from different public sources. Feel free to use it as you need in your apps or send updates into this public repository. It's under MIT license.
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
3 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/annexare/Countries/nodejs.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/annexare/Countries/nodejs.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/phpunit.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/annexare/Countries/phpunit.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/phpunit.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/annexare/Countries/phpunit.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/phpunit.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/annexare/Countries/phpunit.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/nodejs.yml:36
- Info: 0 out of 3 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 2 third-party GitHubAction dependencies pinned
- Info: 1 out of 2 npmCommand dependencies pinned
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/nodejs.yml:1
- Warn: no topLevel permission defined: .github/workflows/phpunit.yml:1
- Info: no jobLevel write permissions found
Reason
Found 2/29 approved changesets -- score normalized to 0
Reason
0 commit(s) and 1 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
- 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
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 8 are checked with a SAST tool
Score
3.6
/10
Last Scanned on 2025-02-03
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