use-location-library
A simple npm package to fetch location data based on the country using the useLocationLibrary function.
npm install good-tenants-country-library
const useLocationLibrary = require('use-location-library');
// Example 1: Using default country ('nigeria') const data1 = useLocationLibrary(); console.log(data1);
// Example 2: Providing a different country const data2 = useLocationLibrary({ country: 'someOtherCountry' });
console.log(data2);
Check out the Live Example to see the library in action https://playcode.io/1749104
- country (optional): A string representing the country for which you want to fetch location data. Default is 'nigeria'. Only 'nigeria', 'kenya', and 'uganda' are supported.
The returned data is an array containing location information for the specified country.
const nigeriaData = useLocationLibrary({ country: 'nigeria' }); console.log(nigeriaData);
const kenyaData = useLocationLibrary({ country: 'kenya' }); console.log(kenyaData);
const ugandaData = useLocationLibrary({ country: 'uganda' }); console.log(ugandaData);
This project is licensed under the MIT License - see the LICENSE.md file for details.