Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
world-information
Advanced tools
world-information is a comprehensive npm package designed to provide detailed geographical information. It includes data on continents, countries, states, and cities, making it an essential tool for applications that require location-based data.
npm install world-information
Continent array
Country array
getCountryByContinentName(continentName);
States
Cities
getStatesByCountryName(countryName);
getCitiesByStateName(stateName);
const worldInformation = require('world-information');
// Get a list of continents
const continents = worldInformation.continentList;
console.log(continents);
// Output:
// [
// { name: 'Africa', code: 'AF' },
// { name: 'Antarctica', code: 'AN' },
// { name: 'Asia', code: 'AS' },
// { name: 'Europe', code: 'EU' },
// { name: 'North America', code: 'NA' },
// { name: 'Oceania', code: 'OC' },
// { name: 'South America', code: 'SA' }
// ]
const worldInformation = require('world-information');
// Get a list of countries
const countries = worldInformation.countryList;
console.log(countries);
// Output (sample):
// [
// { "name": "Afghanistan", "alpha-2": "AF", "alpha-3": "AFG", "numeric": "004", "continent": "Asia" },
// { "name": "Albania", "alpha-2": "AL", "alpha-3": "ALB", "numeric": "008", "continent": "Europe" },
// ...
// { "name": "Zimbabwe", "alpha-2": "ZW", "alpha-3": "ZWE", "numeric": "716", "continent": "Africa" }
// ]
const {getCountryByContinentName} = require("world-information");
// Get a list of countries in asia continent
/*
Make sure the argument name is one of the below continent. I have also configured the JSDoc Annotations, So you will get the suggestions too.
'Africa' | 'Antarctica' | 'Asia' | 'Europe' | 'North America' | 'Oceania' | 'South America'
*/
const asianCountries = getCountryByContinentName("Asia");
console.log(asianCountries);
// Output (sample):
[
{ "name": "Afghanistan", "alpha-2": "AF", "alpha-3": "AFG", "numeric": "004", "continent": "Asia" },
{ "name": "Armenia", "alpha-2": "AM", "alpha-3": "ARM", "numeric": "051", "continent": "Asia" },
...
{ "name": "Yemen", "alpha-2": "YE", "alpha-3": "YEM", "numeric": "887", "continent": "Asia" },
]
Contributions are welcome! Please open an issue or submit a pull request on GitHub to help improve this package. ♥♥♥
FAQs
world-information is a comprehensive npm package designed to provide detailed geographical information. It includes data on continents, countries, states, and cities, making it an essential tool for applications that require location-based data.
The npm package world-information receives a total of 0 weekly downloads. As such, world-information popularity was classified as not popular.
We found that world-information 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.