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-seeker
Advanced tools
This is a Node.js package that allows you to search for countries using different criteria such as country code, dial code, flag, or country name. It exports several functions that can be used in your Node.js projects to retrieve country data.
This is a Node.js package that allows you to search for countries using different criteria such as country code, dial code, flag, or country name. It exports several functions that can be used in your Node.js projects to retrieve country data.
To use this package, you can install it from npm using the following command:
npm install country-seeker
To use this package, you first need to import it into your project:
import { getCountries, useCountry, useDialCode, useFlag, useCountryName, useCountryCode } from "country-seeker";
getCountries
This function returns an array of all the countries in the package's data:
const countries = getCountries();
console.log(countries);
This function takes an object with two properties, type and value, and returns the first country that matches the given criteria:
const countryByCode = useCountry({ type: 'code', value: 'US' });
console.log(countryByCode);
const countryByDialCode = useCountry({ type: 'dial_code', value: '+1' });
console.log(countryByDialCode);
const countryByFlag = useCountry({ type: 'flag', value: '🇺🇸' });
console.log(countryByFlag);
const countryByName = useCountry({ type: 'name', value: 'United States' });
console.log(countryByName);
This function takes a value parameter, which represents the dial code of the country, and returns the first country that matches the given dial code:
const country = useDialCode({ value: '+1' });
console.log(country);
This function takes a value parameter, which represents the flag of the country, and returns the first country that matches the given flag:
const country = useFlag({ value: '🇺🇸' });
console.log(country);
This function takes a value parameter, which represents the name of the country, and returns the first country that matches the given name::
const country = useCountryName({ value: 'United States' });
console.log(country);
This function takes a value parameter, which represents the code of the country, and returns the first country that matches the given code:
const country = useCountryCode({ value: 'US' });
console.log(country);
If you find a bug or have a feature request, please open an issue on the GitHub repository . Pull requests are also welcome. .
FAQs
This is a Node.js package that allows you to search for countries using different criteria such as country code, dial code, flag, or country name. It exports several functions that can be used in your Node.js projects to retrieve country data.
The npm package country-seeker receives a total of 40 weekly downloads. As such, country-seeker popularity was classified as not popular.
We found that country-seeker 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.