
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
location-data-kit
Advanced tools
A Node.js package providing functions to access and search location data including countries, states, and cities.
This is a Node.js package that provides functions to access and search location data including countries, states, and cities.
npm install location-data-kit
const LocationDataKit = require('location-data-kit');
// Fetch all countries
const allCountries = LocationDataKit.fetchAllCountries();
console.log('All Countries:', allCountries);
// Search for countries by name (case-insensitive)
const searchTerm = "France";
const countriesWithName = LocationDataKit.fetchAllCountries(searchTerm);
console.log('Countries with name:', countriesWithName);
// Fetch all states in a specific country
const countryCode = "US"; // Change this to your desired country code
const statesInUS = LocationDataKit.fetchStatesByCountry(countryCode);
console.log('States in US:', statesInUS);
// Search for states in a specific country by name (case-insensitive)
const stateSearchTerm = "California";
const statesInUSWithName = LocationDataKit.fetchStatesByCountry(countryCode, stateSearchTerm);
console.log('States in US with name:', statesInUSWithName);
// Fetch all cities in a specific state
const stateCode = "CA"; // Change this to your desired state code
const citiesInCA = LocationDataKit.fetchCitiesByState(stateCode);
console.log('Cities in CA:', citiesInCA);
// Search for cities in a specific state by name (case-insensitive)
const citySearchTerm = "Los Angeles";
const citiesInCAWithName = LocationDataKit.fetchCitiesByState(stateCode, citySearchTerm);
console.log('Cities in CA with name:', citiesInCAWithName);
This package expects three JSON files to be present in the data folder within the package directory:
countries.json: An array of objects representing countries, each object should have properties like name and optionally code.states.json: An array of objects representing states, each object should have properties like name, countryCode (referencing a country from countries.json).cities.json: An array of objects representing cities, each object should have properties like name, stateCode (referencing a state from states.json).Please note: You need to provide your own data for these files or use existing datasets formatted as mentioned above.
This package is licensed under the MIT License. See the LICENSE file for details.
FAQs
A Node.js package providing functions to access and search location data including countries, states, and cities.
We found that location-data-kit 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.