Gathering detailed insights and metrics for node-countries
Gathering detailed insights and metrics for node-countries
Gathering detailed insights and metrics for node-countries
Gathering detailed insights and metrics for node-countries
countries-list
Continents & countries: ISO 3166-1 alpha-2 code, name, ISO 639-1 languages, capital, currency, native name, phone. JSON, CSV and SQL.
rest-countries-node
A Node.js wrapper library around the API provided by http://restcountries.eu
vtio-node-countries
node-countries-list
List of all countries with names and ISO 3166-1 codes in all languages.
npm install node-countries
Typescript
Module System
Node Version
NPM Version
84.7
Supply Chain
100
Quality
77.1
Maintenance
100
Vulnerability
99.6
License
TypeScript (99.15%)
JavaScript (0.85%)
Total Downloads
759,947
Last Day
55
Last Week
3,843
Last Month
16,306
Last Year
194,681
MIT License
11 Stars
153 Commits
13 Forks
2 Watchers
5 Branches
6 Contributors
Updated on Oct 03, 2024
Minified
Minified + Gzipped
Latest Version
2.4.0
Package Id
node-countries@2.4.0
Unpacked Size
523.58 kB
Size
59.88 kB
File Count
13
NPM Version
10.8.2
Node Version
20.17.0
Published on
Oct 03, 2024
Cumulative downloads
Total Downloads
Last Day
1.9%
55
Compared to previous day
Last Week
-10.7%
3,843
Compared to previous week
Last Month
-1.2%
16,306
Compared to previous month
Last Year
1.3%
194,681
Compared to previous year
1
21
Countries JSON data
Install via npm:
$ npm install node-countries
This module currently has states and provinces for:
getCountries()
1import { getCountries } from 'node-countries'
Return a JSON array with all the countries
1[ 2 { 3 "alpha2": "AC", 4 "alpha3": "", 5 "countryCallingCodes": [ 6 "+247" 7 ], 8 "currencies": [ 9 "USD" 10 ], 11 "ioc": "SHP", 12 "languages": [ 13 "eng" 14 ], 15 "name": "Ascension Island", 16 "status": "reserved", 17 "provinces": null, 18 "alias": null 19 }, 20 { 21 "alpha2": "AD", 22 "alpha3": "AND", 23 "countryCallingCodes": [ 24 "+376" 25 ], 26 "currencies": [ 27 "EUR" 28 ], 29 "ioc": "AND", 30 "languages": [ 31 "cat" 32 ], 33 "name": "Andorra", 34 "status": "assigned", 35 "provinces": null, 36 "alias": null 37 }, 38 ... 39]
All the countries are accessible directly through their ISO 639-1 (two letter code)
1import countries from 'node-countries'; 2 3console.log(countries.AC); 4/* 5 { 6 "alpha2": "AC", 7 "alpha3": "", 8 "countryCallingCodes": [ 9 "+247" 10 ], 11 "currencies": [ 12 "USD" 13 ], 14 "ioc": "SHP", 15 "languages": [ 16 "eng" 17 ], 18 "name": "Ascension Island", 19 "status": "reserved", 20 "provinces": null, 21 "alias": null 22 } 23*/
1import { getCountryByName } from 'node-countries'
Return the matched country object, else null (alias: findCountryByName
)
1import { getCountryByNameOrShortName } from 'node-countries'
Return the matched country object, else null (alias: findCountryByNameOrShortName
)
Return the matched province object, else null (alias: findProvinceByName
)
Return the matched province object, else null (alias: findProvinceByNameOrShortName
)
1import { getCountryByName } from 'node-countries' 2 3console.log(getCountryByName("Andorra")); 4/* 5 { 6 "alpha2": "AD", 7 "alpha3": "AND", 8 "countryCallingCodes": [ 9 "+376" 10 ], 11 "currencies": [ 12 "EUR" 13 ], 14 "ioc": "AND", 15 "languages": [ 16 "cat" 17 ], 18 "name": "Andorra", 19 "status": "assigned", 20 "provinces": null, 21 "alias": null 22 } 23*/
1import countries from "node-countries"; 2 3console.log(getProvinceByName(countries.CA, "Labrador", false)); 4/* 5 null 6*/ 7 8console.log(getProvinceByName(countries.CA, "Labrador", true)); 9/* 10 { 11 "short": "NL", 12 "name": "Newfoundland and Labrador", 13 "alias": [ 14 "Newfoundland", 15 "Labrador" 16 ] 17 } 18*/
Inspired by country-data and provinces
This project is a work in progress and subject to API changes, please feel free to contribute
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/6 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
Reason
10 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-09
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