good-tenants-country-library

1.0.4 • Public • Published

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.

Package Sidebar

Install

npm i good-tenants-country-library

Weekly Downloads

5

Version

1.0.4

License

MIT

Unpacked Size

73.5 kB

Total Files

3

Last publish

Collaborators

  • meshmmanuel