Skip to content

Commit

Permalink
doc: Update README.md to reflect module name change and enhance featu…
Browse files Browse the repository at this point in the history
…re descriptions
  • Loading branch information
casualmatt committed Nov 28, 2024
1 parent e18d40a commit 685ec80
Showing 1 changed file with 60 additions and 13 deletions.
73 changes: 60 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,89 @@
Get your module up and running quickly.
Find and replace all on all files (CMD+SHIFT+F):
- Name: My Module
- Package name: my-module
- Description: My new Nuxt module
- Name: User Country Module
- Package name: user-country-module
- Description: A Nuxt module to fetch and display user country information
-->

# My Module
# User Country Module

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![License][license-src]][license-href]
[![Nuxt][nuxt-src]][nuxt-href]

My new Nuxt module for doing amazing things.
A Nuxt module to fetch and display user country information.

- [ Release Notes](/CHANGELOG.md)
<!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/my-module?file=playground%2Fapp.vue) -->
## Why Use This Module?

When compared to other free alternatives, this module stands out because:
- **It's really fast:** With an average global latency of just 25ms, it's one of the fastest options available.
- **Effective localization suggestions:** It works well to suggest changing the user's country or language/currency based on their location, making it ideal for enhancing the user experience.
- **No browser location sharing required:** Unlike some other solutions, it doesn't require the user to share their precise browser location, ensuring better privacy while still delivering accurate information.

<!-- - [✨ &nbsp;Release Notes](/CHANGELOG.md) -->
<!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/user-country-module?file=playground%2Fapp.vue) -->
<!-- - [📖 &nbsp;Documentation](https://example.com) -->

## Features

<!-- Highlight some of the features your module provide here -->
-&nbsp;Foo
- 🚠 &nbsp;Bar
- 🌲 &nbsp;Baz
- 🌍 &nbsp;Fetch user country information from JAMflow free API.
- 🌐 &nbsp;Display user country ISO and Full Name.
- 🗺️ &nbsp;Supports 250 countries, autonomous regions, ...
-&nbsp;Extremely fast detection and response time.

## Free API service
The module bases its detection on a network of 119 PoP, with an average global latency of 25ms. The API is offered by JAMflow.cloud and is free to use, without any guarantee. We will limit IP or website that will spam or abuse the service.

### Commercial use
You are allowed to use the service for any commercial use, but you are not allowed to resell it without an agreement with us beforehand.

### API Rate Limit

We limit requests to 3 requests per second per IP address. If you need a higher rate limit, please contact us.

###

## Quick Setup

Install the module to your Nuxt application with one command:

```bash
npx nuxi module add my-module
npx nuxi module add user-country-module
```

That's it! You can now use the User Country Module in your Nuxt app ✨

## Usage

### `useUserCountry` Composable

The `useUserCountry` composable fetches the user's country information based on their IP address.

#### Example

```vue
<template>
<div>
<p>{{ status }}</p>
<p v-if="status === 'success'">Your country is: {{ data.name }}</p>
<p v-if="status === 'error'">Error: {{ data }}</p>
<button @click="refresh">Refresh</button>
</div>
</template>
<script setup>
const { data, refresh, status } = await useUserCountry();
</script>
```

That's it! You can now use My Module in your Nuxt app ✨
#### API

- `data`: The country information object containing `name` and `iso`.
- `refresh`: Function to refresh the country information.
- `status`: The status of the fetch request (`'idle'`, `'loading'`, `'success'`, `'error'`).

## Contribution

Expand Down Expand Up @@ -69,7 +117,6 @@ That's it! You can now use My Module in your Nuxt app ✨

</details>


<!-- Badges -->
[npm-version-src]: https://img.shields.io/npm/v/my-module/latest.svg?style=flat&colorA=020420&colorB=00DC82
[npm-version-href]: https://npmjs.com/package/my-module
Expand Down

0 comments on commit 685ec80

Please sign in to comment.