Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
countryinfo
Advanced tools
Readme
country. provides all kinds of data on countries. It offers the following information:
Code | Language |
---|---|
ar | Arabic |
cs | Czech |
de | German |
en | English |
et | Estonian |
fi | Finnish |
fr | French |
it | Italian |
nb | Norwegian Bokmål |
nn | Norwegian Nynorsk |
nl | Dutch |
pl | Polish |
pt | Portuguese |
ru | Russian |
sv | Swedish |
tr | Turkish |
zh | Chinese |
This library also classifies countries into regions. The following regions are supported:
Asia (Central + Southern + Southeast + East + Western)
Central Asia
Southern Asia
Southeast Asia
East Asia
Western Asia
Africa (Central + North + Southern + East + West)
Central Africa
North Africa
Southern Africa
East Africa
West Africa
Europe (Northern + Southern + Eastern + Western)
Northern Europe
Southern Europe
Eastern Europe
Western Europe
America (Central + Northern + Southern)
Central America
Northern America
South America
Other
Australia
Melanesia
Micronesia
Polynesia
Antartica
Caribbean
Require country. in your project.
'use strict';
const country = require('countryinfo');
// ISO 3166-1 numeric identifiers from ...
country.iso1('DE'); // ... ISO 3166-1 alpha-2
country.iso1('DEU'); // ... ISO 3166-1 alpha-3
country.iso1('Germany'); // ... country name
country.iso1('Deutschland', 'de'); // ... localized country name
// ISO 3166-1 alpha-2 identifiers from ...
country.iso2('276'); // ... ISO 3166-1 numeric
country.iso2('DEU'); // ... ISO 3166-1 alpha-3
country.iso2('Germany'); // ... country name
country.iso2('Deutschland', 'de'); // ... localized country name
// ISO 3166-1 alpha-3 identifiers from ...
country.iso3('276'); // ... ISO 3166-1 numeric
country.iso3('DE'); // ... ISO 3166-1 alpha-2
country.iso3('Germany'); // ... country name
country.iso3('Deutschland', 'de'); // ... localized country name
// IOC identifiers from ...
country.ioc('276'); // ... ISO 3166-1 numeric
country.ioc('DE'); // ... ISO 3166-1 alpha-2
country.ioc('DEU'); // ... ISO 3166-1 alpha-3
country.ioc('Germany'); // ... country name
country.ioc('Deutschland', 'de'); // ... localized country name
// Spoken languages from ...
country.languages('276'); // ... ISO 3166-1 numberic
country.languages('DE'); // ... ISO 3166-1 alpha-2
country.languages('DEU'); // ... ISO 3166-1 alpha-3
country.languages('Germany'); // ... country name
country.languages('Deutschland', 'de'); // ... localized country name
// Used currencies in country from ...
country.currencies('276'); // ... ISO 3166-1 numberic
country.currencies('DE'); // ... ISO 3166-1 alpha-2
country.currencies('DEU'); // ... ISO 3166-1 alpha-3
country.currencies('Germany'); // ... country name
country.currencies('Deutschland', 'de'); // ... localized country name
// Complete data of country from ...
country.data('276'); // ... ISO 3166-1 numberic
country.data('DE'); // ... ISO 3166-1 alpha-2
country.data('DEU'); // ... ISO 3166-1 alpha-3
country.data('Germany'); // ... country name
country.data('Deutschland', 'de'); // ... localized country name
// Region data
country.regions(); // all regions
country.regionsData(); // all regions including data for all countries (ISO 3166-1 codes, IOC,...)
country.regions('europe'); // find region by identifier ...
country.regions('Central Asia'); // ... or by name
country.regionsData('europe'); // complete region data by identifier...
country.regionsData('Central Asia'); // ... or by name
If you want to add additional country names to the list, feel free to do so in the /lib/data/names.json
file. The structure should be clear.
{
"DE": { // ISO 3166-1 alpha-2 identifier
"en": ["Germany"], // array of to be added names in the set locale
"ar": [" ألمانيا"]
}
}
To import the data into the library, run make
in the root directory. This recreates the /lib/data/masterData.json
file.
countrySynonyms
i18n-iso-countries
country-data
Run make
in the root directory of the project and copy the /lib/data/masterData.json
file. This file contains all the mentioned data.
In package json:
npm test
- run testsnpm run cleaner
- update master dataFAQs
ISO-codes, currencies, languages... All you need to know about countries.
The npm package countryinfo receives a total of 277 weekly downloads. As such, countryinfo popularity was classified as not popular.
We found that countryinfo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.