{"_id":"@dear-rama/country-query","_rev":"1-02242158d394465f99c853b2551ce9ef","name":"@dear-rama/country-query","dist-tags":{"latest":"2.0.2"},"versions":{"2.0.2":{"name":"@dear-rama/country-query","version":"2.0.2","description":"A javascript query API for world-countries data","repository":{"type":"git","url":"git+https://github.com/DearRAMA/country-query.git"},"bugs":{"url":"https://github.com/DearRAMA/country-query/issues"},"main":"index.js","directories":{"test":"test"},"publishConfig":{"access":"public"},"dependencies":{"lodash":"^4.17.21","world-countries":"^4.0.0"},"devDependencies":{"chai":"4.2.0","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","mocha":"^8.1.3","prettier":"2.1.1","typescript":"^4.6.2"},"scripts":{"test":"mocha"},"keywords":["country","countries","currencies","iso","languages","regions"],"author":{"name":"NakWon CHOI","email":"ch0494@gmail.com"},"license":"ISC","types":"./index.d.ts","gitHead":"edc5f62964b7af7d342ea830068721cbe9a4ca06","homepage":"https://github.com/DearRAMA/country-query#readme","_id":"@dear-rama/country-query@2.0.2","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"integrity":"sha512-1QGM3ewP7Ip/0GaAID12J2OJ/ugJlYsXvZKxvDdbz00oDXH2yh0ouNeV1iHZ/0HwJoGTgPPFijYAFokPhLXKgQ==","shasum":"cd64bfaecf4443653bf58bd9caf0559d2bb72d25","tarball":"https://registry.npmjs.org/@dear-rama/country-query/-/country-query-2.0.2.tgz","fileCount":14,"unpackedSize":39055,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiH6zEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqaqw/+JoWONJ3Y3i4qVHXxVKUz5mi0um7eEgM3OnvgfI3gB/bSWbXW\r\nmBp+opq+JrmARRyk2WXQuxLsAcGhl1P/+owDvCTReAeLVd8plTXNCkc4eMbZ\r\ni/Zm/B4wO1Tfo7IwcO1SAG1fJDEt05aGq5fdsixyNaKNLpyzl95SP+3Hb1XF\r\n3Hou3CRshEDEpiEls0XYuB2GJpdof1piK6f4fU7OIvu8AbC4kyCH7aE+wFc8\r\nC7NQ7nOFxGxbT+QxgJoVQeYxifgYZ+ZKhR/6uHh813VnVF2Q2CMd9FFgUEJq\r\nM++bg7NV56mPgK+bmhDxGFhcIppVCYu7DbuLv387BVEYRoFL86a6N3lvO7T7\r\nJGX8u1862cka87pV0TNh4y3wp+4WnfzI8Lo2VQlAMtjKMrxGwg8FmR88byFg\r\nrXQyigtR4yQNZoDJiFQoL39u5F0OcFMpHqhNft89tOPi1DZtmrQZBnKfpJcX\r\nbfXj/VLqQnoMb5U5wcXiDufRPNsAs/T5dBpK4P81qwKCecMx5mMkCZ6lJAXj\r\n2tSNkaz6xqfS1ceb4yrCt9TfJy2hj8MpNk0ALwqe2GzAzkQ0HpkXDpWNrfC9\r\nU7macdb83YnGxF/uuADDrAp9wl4DUoCdxtpMJ58yMy02pwcplw+F996Cntpt\r\nN0kwM7eBBSBgjGBdR2JZ8NKX/zb2waHBmNY=\r\n=+Zks\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGBCZAxFRZn/fM0IysMkykNGv6rDnDxxsIAFEiWS3c5TAiEA22DvUaehPbfyM9tPYB47+Wq6UoG1c9kuZaAWdU4MTVE="}]},"_npmUser":{"name":"dmc31a42","email":"ch0494@gmail.com"},"maintainers":[{"name":"dmc31a42","email":"ch0494@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/country-query_2.0.2_1646243011940_0.12432657164040117"},"_hasShrinkwrap":false}},"time":{"created":"2022-03-02T17:43:31.866Z","2.0.2":"2022-03-02T17:43:32.106Z","modified":"2022-04-05T03:28:04.594Z"},"maintainers":[{"name":"dmc31a42","email":"ch0494@gmail.com"}],"description":"A javascript query API for world-countries data","homepage":"https://github.com/DearRAMA/country-query#readme","keywords":["country","countries","currencies","iso","languages","regions"],"repository":{"type":"git","url":"git+https://github.com/DearRAMA/country-query.git"},"author":{"name":"NakWon CHOI","email":"ch0494@gmail.com"},"bugs":{"url":"https://github.com/DearRAMA/country-query/issues"},"license":"ISC","readme":"# country-query\r\n\r\n![CI](https://github.com/petert82/country-query/workflows/CI/badge.svg)\r\n\r\nA javascript query API for [world-countries][world-countries] data.\r\n\r\n## Table of contents\r\n\r\n- [API](#api)\r\n- [Thanks](#thanks)\r\n- [License](#license)\r\n\r\n## API\r\n\r\n### find(by, value)\r\n\r\nFinds data for one or more countries matching some search value.\r\n\r\nTakes 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`.\r\n\r\nThis function is not case-sensitive, i.e the input values `German`, `german` and `gErMaN` would all match the language `German`.\r\n\r\n```js\r\nvar CountryQuery = require('country-query')\r\n\r\nvar austria = CountryQuery.find('cca2', 'AT')\r\nvar germany = CountryQuery.find('demonym', 'German')\r\n\r\n// austria and germany will both be objects with this structure:\r\n/*\r\n    {\r\n        \"name\": {\r\n            \"common\": \"Austria\",\r\n            \"official\": \"Republic of Austria\",\r\n            \"native\": {\r\n                \"bar\": {\r\n                    \"official\": \"Republik Österreich\",\r\n                    \"common\": \"Österreich\"\r\n                }\r\n            }\r\n        },\r\n        \"tld\": [\".at\"],\r\n        \"cca2\": \"AT\",\r\n        \"ccn3\": \"040\",\r\n        \"cca3\": \"AUT\",\r\n        \"cioc\": \"AUT\",\r\n        \"independent\": true,\r\n        \"status\": \"officially-assigned\",\r\n        \"currencies\": {\r\n            \"EUR\": { \"name\": \"Euro\", \"symbol\": \"\\u20ac\" }\r\n        },\r\n        \"idd\": {\r\n            \"root\": \"+4\",\r\n            \"suffixes\": [\"3\"]\r\n        },\r\n        \"capital\": [\"Vienna\"],\r\n        \"altSpellings\": [\"AT\", \"Osterreich\", \"Oesterreich\"],\r\n        \"region\": \"Europe\",\r\n        \"subregion\": \"Western Europe\",\r\n        \"languages\": {\r\n            \"bar\": \"Austro-Bavarian German\"\r\n        },\r\n        \"translations\": {\r\n            \"ces\": {\r\n                \"official\": \"Rakouská republika\",\r\n                \"common\": \"Rakousko\"\r\n            },\r\n            \"cym\": {\r\n                \"official\": \"Gweriniaeth Awstria\",\r\n                \"common\": \"Awstria\"\r\n            },\r\n            \"deu\": {\r\n                \"official\": \"Republik Österreich\",\r\n                \"common\": \"Österreich\"\r\n            },\r\n            // ...snip...\r\n        },\r\n        \"latlng\": [47.33333333, 13.33333333],\r\n        \"landlocked\": true,\r\n        \"borders\": [\"CZE\", \"DEU\", \"HUN\", \"ITA\", \"LIE\", \"SVK\", \"SVN\", \"CHE\"],\r\n        \"area\": 83871,\r\n        \"flag\": \"\\ud83c\\udde6\\ud83c\\uddf9\",\r\n        \"demonyms\": {\r\n            \"eng\": {\r\n                \"f\": \"Austrian\",\r\n                \"m\": \"Austrian\"\r\n            },\r\n            \"fra\": {\r\n                \"f\": \"Autrichienne\",\r\n                \"m\": \"Autrichien\"\r\n            }\r\n        }\r\n    }\r\n */\r\n\r\nvar euroCountries = CountryQuery.find('currencies', 'EUR')\r\n\r\n// euroCountries will be an array of country objects\r\n```\r\n\r\nAcceptable values for `by` are:\r\n\r\n- `tld`\r\n- `currencies`\r\n- `idd`\r\n- `altSpellings`\r\n- `latlng`\r\n- `borders`\r\n- `name.common`\r\n- `name.official`\r\n- `name.native`\r\n- `translations`\r\n- `languages`\r\n- `cca2`\r\n- `ccn3`\r\n- `cca3`\r\n- `capital`\r\n- `cioc`\r\n- `region`\r\n- `subregion`\r\n- `demonyms`\r\n- `landlocked`\r\n- `area`\r\n\r\n### findByArea(area)\r\n\r\nFind country by its area.\r\n\r\nReturn value is the same as [find](#findby-value).\r\n\r\n### findByAltSpelling(altSpelling)\r\n\r\nFind country by alternative spellings of its name.\r\n\r\nReturn value is the same as [find](#findby-value).\r\n\r\n### findByBorders(borders)\r\n\r\nFind country by countries that it borders\r\n\r\nReturn value is the same as [find](#findby-value).\r\n\r\n### findByIdd(idd)\r\n\r\nFind country by telephone calling code.\r\n\r\nReturn value is the same as [find](#findby-value).\r\n\r\n### findByCapital(capital)\r\n\r\nFind country by its capital city.\r\n\r\nReturn value is the same as [find](#findby-value).\r\n\r\n### findByCca2(cca2)\r\n\r\nFind country by 2-letter country code.\r\n\r\nReturn value is the same as [find](#findby-value).\r\n\r\n### findByCca3(cca3)\r\n\r\nFind country by 3-letter country code.\r\n\r\nReturn value is the same as [find](#findby-value).\r\n\r\n### findByCcn3(ccn3)\r\n\r\nFind country by numeric country code.\r\n\r\nReturn value is the same as [find](#findby-value).\r\n\r\n### findByCioc(cioc)\r\n\r\nFind country by 3-letter International Olympic Commitee country code.\r\n\r\nReturn value is the same as [find](#findby-value).\r\n\r\n### findByCurrency(currency)\r\n\r\nFind country by currency.\r\n\r\nReturn value is the same as [find](#findby-value).\r\n\r\n### findByDemonym(demonym)\r\n\r\nFind country by one of the demonyms used for its citizens.\r\n\r\nReturn value is the same as [find](#findby-value).\r\n\r\n### findByLandlocked(landlocked)\r\n\r\nFind country by whether or not it is landlocked.\r\n\r\nReturn value is the same as [find](#findby-value).\r\n\r\n### findByLanguage(language)\r\n\r\nFind country by its language.\r\n\r\nReturn value is the same as [find](#findby-value).\r\n\r\n### findByNameCommon(name)\r\n\r\nFind country by its common name.\r\n\r\nReturn value is the same as [find](#findby-value).\r\n\r\n### findByNameNative(name)\r\n\r\nFind country by its native name.\r\n\r\nReturn value is the same as [find](#findby-value).\r\n\r\n### findByNameOfficial(name)\r\n\r\nFind country by its official name.\r\n\r\nReturn value is the same as [find](#findby-value).\r\n\r\n### findByRegion(region)\r\n\r\nFind country by the region it is located in.\r\n\r\nReturn value is the same as [find](#findby-value).\r\n\r\n### findBySubregion(subregion)\r\n\r\nFind country by subregion it is located in.\r\n\r\nReturn value is the same as [find](#findby-value).\r\n\r\n### findByTld(tld)\r\n\r\nFind country by top level domain.\r\n\r\nReturn value is the same as [find](#findby-value).\r\n\r\n### findByTranslation(translation)\r\n\r\nFind country by translations of its name.\r\n\r\nReturn value is the same as [find](#findby-value).\r\n\r\n## Thanks\r\n\r\nThis project would not exist without the work of the contributors to the [world-countries][world-countries] data set.\r\n\r\n## License\r\n\r\nCopyright (C) 2015, Peter Thompson <peter.thompson@dunelm.org.uk>\r\n\r\nPermission 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.\r\n\r\nTHE 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.\r\n\r\n[world-countries]: https://github.com/mledoze/countries\r\n","readmeFilename":"README.md"}