Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
country-list-js
Advanced tools
https://i-rocky.github.io/country-list-js/ https://www.npmjs.com/package/country-list-js
<script src="/path/to/country.min.js"></script>
or
npm install country-list-js
var country = new Country;
var found = country.find('BD', country.FIND_BY_ISO_ALPHA_2);
var found = country.find('BGD', country.FIND_BY_ISO_ALPHA_3);
var found = country.find('Bangladesh', country.FIND_BY_NAME);
var found = country.find('Capital', country.FIND_BY_CAPITAL);
var found = country.find('BDT', country.FIND_BY_CURRENCY);
The search option can also be hard coded as following
country.FIND_BY_ALPHA_2 = 1
country.FIND_BY_ALPHA_3 = 2
country.FIND_BY_NAME = 3
country.FIND_BY_CAPITAL = 4
country.FIND_BY_CURRENCY = 5
country.find('BD', country.FIND_BY_ISO_ALPHA_2);
can be written as country.find('BD', 1);
If the country was not found, the variable found
will be ```null.
The return value of all of those above will be similar to the following
{
continent: "Asia",
name: "Bangladesh",
code: {
iso_alpha_2: "BD",
iso_alpha_3: "BGD"
},
capital: "Dhaka",
currency: "BDT",
dialing_code: "880"
}
Once the search has been made, if the country was found, the information is stored in the instance. We can retrieve the information without having to search again.
var found = country.info();
var name = country.info('name'); //Bangladesh
var iso_alpha_2 = country.info('iso_alpha_2'); //BD
var iso_alpha_3 = country.info('iso_alpha_3'); //BGD
var continent = country.info('continent'); //Asia
var capital = country.info('capital'); //Dhaka
var currency = country.info('currency'); //BDT
var dialing_code = country.info('dialing_code'); //880
npm run test
npm run build
FAQs
Country list with ISO2, ISO3 code, continent, capital, dialing code
The npm package country-list-js receives a total of 7,755 weekly downloads. As such, country-list-js popularity was classified as popular.
We found that country-list-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.