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.
react-select-country-list
Advanced tools
Maps ISO 3166-1-alpha-2 codes to English country names and match react-select options props
Maps ISO 3166-1-alpha-2 codes to English country names and match react-select options props.
Uses data from http://data.okfn.org/data/country-list
var countries = require('country-list')();
console.log(countries.getValue('IS')); // Iceland
console.log(countries.getLabel('Iceland')); // IS
Usage:
var countries = require('country-list')();
All input is case-insensitive.
Expects a two-digit country code.
Returns the name for that country.
If not found, it returns undefined
.
Expects the English country name.
Returns the code for that country.
If not found, it returns undefined
.
Returns an array of all country names.
Returns an array of all country codes.
Returns a key-value object of all countries using the name as key.
Returns a key-value object of all countries using the code as key.
Returns an array of all country information, in the same format as it gets imported.
class CountrySelector extends Component {
constructor(props) {
super(props)
this.options = countryList().getData()
this.state = {
options: this.options,
value: null,
}
}
changeHandler = value => {
this.setState({ value })
}
render() {
return (
<Select
options={this.state.options}
value={this.state.value}
onChange={this.changeHandler}
/>
)
}
}
npm install react-select-country-list
MIT
FAQs
Maps ISO 3166-1-alpha-2 codes to English country names and match react-select options props
The npm package react-select-country-list receives a total of 29,705 weekly downloads. As such, react-select-country-list popularity was classified as popular.
We found that react-select-country-list 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.
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.