Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
country-state-city-nextjs
Advanced tools
This is a library for get all countrys, states and citys of world.
Using npm:
npm i country-state-city-nextjs
import {
load,
countryProps,
stateProps,
cityProps,
useCSCProps,
loadCountrys,
loadStates,
loadCitys,
useCSC,
} from "country-state-city-nextjs";
const [CSC, setCSC] = useState<{
countrys: countryProps[];
states: stateProps[];
citys: cityProps[];
}>({
countrys: [],
states: [],
citys: [],
});
const loadCSC = async () => {
const countrys: countryProps[] = await loadCountrys();
const states: stateProps[] = await loadStates();
const citys: cityProps[] = await loadCitys();
setCSC({
countrys,
states,
citys,
});
};
useEffect(() => {
loadCSC();
}, []);
const {
load, //is load all countrys, states and citys
countrySelected, //current country selected
stateSelected, //current state selected
citySelected, //current city selected
countrys, //all countrys
states, //all states
citys, //all citys
onChangeCSC, //object of functions for change selected country, state and city
statesForCountrySelected // all states of countrySelected
citysForStateSelected // all citys of stateSelected
} = useCSC({
//(Optional)
defaultCountry: {
id: 82,
text: "Colombia",
},
//(Optional)
defaultState: {
id: 1700,
id_country: 82,
text: "Antioquia",
},
//(Optional)
defaultCity: {
id: 465167,
id_state: 1700,
text: "Medellín",
},
});
// change country; state and city change to null
onChangeCSC.country({
id: 95,
text: "Venezuela",
});
// change state; city change to null
// if countrySelected is null onChangeCSC.state not change state
onChangeCSC.state({
id: 1861,
id_country: 95,
text: "Táchira",
});
// change city
// if stateSelected is null onChangeCSC.city not change city
onChangeCSC.city({
id: 590202,
id_state: 1861,
text: "Peracal",
});
Email blancofrancisco34@gmail.com
FAQs
Get all countrys, states and citys of world
The npm package country-state-city-nextjs receives a total of 292 weekly downloads. As such, country-state-city-nextjs popularity was classified as not popular.
We found that country-state-city-nextjs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.