1.0.2 • Published 5 months ago

react_country_finder v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

Country finder

This api and module can be used to get your clients country details. You can use this as an API or install it for react.

Use it as an API

Write the following in the HTML head tag, to use the API:

<script src="https://thorvaldemar.github.io/country_finder/api.js"></script>

You can now use the API from another script the following way:

// Inside an async function
const country = await getCountry();

// Inside a sync function
let country;
getCountry().then(found => country = found);

Use is in React

Install it using NPM

npm i react_country_finder

To get the country, you can simply import the module and use it as a function - like this:

const getCountry = require('react_country_finder');
const country = getCountry();

Or with TypeScript:

import getCountry from 'react_country_finder';
const country = getCountry();
1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago