good-tenants-country-library v1.0.4
use-location-library
A simple npm package to fetch location data based on the country using the useLocationLibrary function.
Installation
npm install good-tenants-country-library
Usage
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);
Live Example
Check out the Live Example to see the library in action https://playcode.io/1749104
Parameters
- 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.
Data Structure
The returned data is an array containing location information for the specified country.
Examples
Nigeria
const nigeriaData = useLocationLibrary({ country: 'nigeria' }); console.log(nigeriaData);
Kenya
const kenyaData = useLocationLibrary({ country: 'kenya' }); console.log(kenyaData);
Uganda
const ugandaData = useLocationLibrary({ country: 'uganda' }); console.log(ugandaData);
License
This project is licensed under the MIT License - see the LICENSE.md file for details.