Skip to content

Commit 685ec80

Browse files
committed
doc: Update README.md to reflect module name change and enhance feature descriptions
1 parent e18d40a commit 685ec80

File tree

1 file changed

+60
-13
lines changed

1 file changed

+60
-13
lines changed

README.md

+60-13
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,89 @@
22
Get your module up and running quickly.
33
44
Find and replace all on all files (CMD+SHIFT+F):
5-
- Name: My Module
6-
- Package name: my-module
7-
- Description: My new Nuxt module
5+
- Name: User Country Module
6+
- Package name: user-country-module
7+
- Description: A Nuxt module to fetch and display user country information
88
-->
99

10-
# My Module
10+
# User Country Module
1111

1212
[![npm version][npm-version-src]][npm-version-href]
1313
[![npm downloads][npm-downloads-src]][npm-downloads-href]
1414
[![License][license-src]][license-href]
1515
[![Nuxt][nuxt-src]][nuxt-href]
1616

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

19-
- [ Release Notes](/CHANGELOG.md)
20-
<!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/my-module?file=playground%2Fapp.vue) -->
19+
## Why Use This Module?
20+
21+
When compared to other free alternatives, this module stands out because:
22+
- **It's really fast:** With an average global latency of just 25ms, it's one of the fastest options available.
23+
- **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.
24+
- **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.
25+
26+
<!-- - [✨ &nbsp;Release Notes](/CHANGELOG.md) -->
27+
<!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/user-country-module?file=playground%2Fapp.vue) -->
2128
<!-- - [📖 &nbsp;Documentation](https://example.com) -->
2229

2330
## Features
2431

2532
<!-- Highlight some of the features your module provide here -->
26-
-&nbsp;Foo
27-
- 🚠 &nbsp;Bar
28-
- 🌲 &nbsp;Baz
33+
- 🌍 &nbsp;Fetch user country information from JAMflow free API.
34+
- 🌐 &nbsp;Display user country ISO and Full Name.
35+
- 🗺️ &nbsp;Supports 250 countries, autonomous regions, ...
36+
-&nbsp;Extremely fast detection and response time.
37+
38+
## Free API service
39+
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.
40+
41+
### Commercial use
42+
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.
43+
44+
### API Rate Limit
45+
46+
We limit requests to 3 requests per second per IP address. If you need a higher rate limit, please contact us.
47+
48+
###
2949

3050
## Quick Setup
3151

3252
Install the module to your Nuxt application with one command:
3353

3454
```bash
35-
npx nuxi module add my-module
55+
npx nuxi module add user-country-module
56+
```
57+
58+
That's it! You can now use the User Country Module in your Nuxt app ✨
59+
60+
## Usage
61+
62+
### `useUserCountry` Composable
63+
64+
The `useUserCountry` composable fetches the user's country information based on their IP address.
65+
66+
#### Example
67+
68+
```vue
69+
<template>
70+
<div>
71+
<p>{{ status }}</p>
72+
<p v-if="status === 'success'">Your country is: {{ data.name }}</p>
73+
<p v-if="status === 'error'">Error: {{ data }}</p>
74+
<button @click="refresh">Refresh</button>
75+
</div>
76+
</template>
77+
78+
<script setup>
79+
const { data, refresh, status } = await useUserCountry();
80+
</script>
3681
```
3782

38-
That's it! You can now use My Module in your Nuxt app ✨
83+
#### API
3984

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

4189
## Contribution
4290

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

70118
</details>
71119

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

0 commit comments

Comments
 (0)