Gathering detailed insights and metrics for @dear-rama/country-query
Gathering detailed insights and metrics for @dear-rama/country-query
Gathering detailed insights and metrics for @dear-rama/country-query
Gathering detailed insights and metrics for @dear-rama/country-query
npm install @dear-rama/country-query
Typescript
Module System
Node Version
NPM Version
72.8
Supply Chain
98.9
Quality
75.2
Maintenance
100
Vulnerability
99.3
License
JavaScript (100%)
Total Downloads
294
Last Day
2
Last Week
3
Last Month
7
Last Year
53
42 Commits
2 Branches
Latest Version
2.0.2
Package Id
@dear-rama/country-query@2.0.2
Unpacked Size
38.14 kB
Size
8.35 kB
File Count
14
NPM Version
8.1.2
Node Version
16.13.2
Cumulative downloads
Total Downloads
Last day
0%
2
Compared to previous day
Last week
200%
3
Compared to previous week
Last month
75%
7
Compared to previous month
Last year
-45.9%
53
Compared to previous year
2
6
A javascript query API for world-countries data.
Finds data for one or more countries matching some search value.
Takes a property name to search by and a value to search for. If the value matches a single country, an object containing that country's data will be returned. If the value matches more than one country, an array of country objects will be returned. If no countries match, or an invalid property name is used, returns null
.
This function is not case-sensitive, i.e the input values German
, german
and gErMaN
would all match the language German
.
1var CountryQuery = require('country-query') 2 3var austria = CountryQuery.find('cca2', 'AT') 4var germany = CountryQuery.find('demonym', 'German') 5 6// austria and germany will both be objects with this structure: 7/* 8 { 9 "name": { 10 "common": "Austria", 11 "official": "Republic of Austria", 12 "native": { 13 "bar": { 14 "official": "Republik Österreich", 15 "common": "Österreich" 16 } 17 } 18 }, 19 "tld": [".at"], 20 "cca2": "AT", 21 "ccn3": "040", 22 "cca3": "AUT", 23 "cioc": "AUT", 24 "independent": true, 25 "status": "officially-assigned", 26 "currencies": { 27 "EUR": { "name": "Euro", "symbol": "\u20ac" } 28 }, 29 "idd": { 30 "root": "+4", 31 "suffixes": ["3"] 32 }, 33 "capital": ["Vienna"], 34 "altSpellings": ["AT", "Osterreich", "Oesterreich"], 35 "region": "Europe", 36 "subregion": "Western Europe", 37 "languages": { 38 "bar": "Austro-Bavarian German" 39 }, 40 "translations": { 41 "ces": { 42 "official": "Rakouská republika", 43 "common": "Rakousko" 44 }, 45 "cym": { 46 "official": "Gweriniaeth Awstria", 47 "common": "Awstria" 48 }, 49 "deu": { 50 "official": "Republik Österreich", 51 "common": "Österreich" 52 }, 53 // ...snip... 54 }, 55 "latlng": [47.33333333, 13.33333333], 56 "landlocked": true, 57 "borders": ["CZE", "DEU", "HUN", "ITA", "LIE", "SVK", "SVN", "CHE"], 58 "area": 83871, 59 "flag": "\ud83c\udde6\ud83c\uddf9", 60 "demonyms": { 61 "eng": { 62 "f": "Austrian", 63 "m": "Austrian" 64 }, 65 "fra": { 66 "f": "Autrichienne", 67 "m": "Autrichien" 68 } 69 } 70 } 71 */ 72 73var euroCountries = CountryQuery.find('currencies', 'EUR') 74 75// euroCountries will be an array of country objects
Acceptable values for by
are:
tld
currencies
idd
altSpellings
latlng
borders
name.common
name.official
name.native
translations
languages
cca2
ccn3
cca3
capital
cioc
region
subregion
demonyms
landlocked
area
Find country by its area.
Return value is the same as find.
Find country by alternative spellings of its name.
Return value is the same as find.
Find country by countries that it borders
Return value is the same as find.
Find country by telephone calling code.
Return value is the same as find.
Find country by its capital city.
Return value is the same as find.
Find country by 2-letter country code.
Return value is the same as find.
Find country by 3-letter country code.
Return value is the same as find.
Find country by numeric country code.
Return value is the same as find.
Find country by 3-letter International Olympic Commitee country code.
Return value is the same as find.
Find country by currency.
Return value is the same as find.
Find country by one of the demonyms used for its citizens.
Return value is the same as find.
Find country by whether or not it is landlocked.
Return value is the same as find.
Find country by its language.
Return value is the same as find.
Find country by its common name.
Return value is the same as find.
Find country by its native name.
Return value is the same as find.
Find country by its official name.
Return value is the same as find.
Find country by the region it is located in.
Return value is the same as find.
Find country by subregion it is located in.
Return value is the same as find.
Find country by top level domain.
Return value is the same as find.
Find country by translations of its name.
Return value is the same as find.
This project would not exist without the work of the contributors to the world-countries data set.
Copyright (C) 2015, Peter Thompson peter.thompson@dunelm.org.uk
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
No vulnerabilities found.
No security vulnerabilities found.