countries-api-json 1.0.0 β†’ 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +71 -0
  2. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,71 @@
1
+ # countries-api-json
2
+
3
+ [![NPM Version][npm-image]][npm-url]
4
+ [![Downloads Stats][npm-downloads]][npm-url]
5
+
6
+ A comprehensive list of countries and their details in JSON format. Useful for applications that need country data for various purposes such as dropdowns, validations, etc.
7
+
8
+ ## Installation
9
+
10
+ To install this package, run:
11
+
12
+ ```bash
13
+ npm install countries-api-json
14
+ ```
15
+
16
+ ## Usage
17
+
18
+ Here is a basic example of how to use this package:
19
+
20
+ ```javascript
21
+ const countries = require('countries-api-json');
22
+
23
+ // Example usage
24
+ console.log(countries); // Prints the entire list of countries
25
+
26
+ // Accessing specific country details
27
+ const zambia = countries.find(country => country.code === 'ZM');
28
+ console.log(zambia); // { name: 'Zambia', code: 'ZM', dial_code: '+260', flag: 'πŸ‡ΏπŸ‡²' }
29
+ ```
30
+
31
+ ## API
32
+
33
+ The package exports a JSON array of country objects. Each country object contains the following properties:
34
+
35
+ - `name` (String): The name of the country.
36
+ - `code` (String): The ISO 3166-1 alpha-2 code of the country.
37
+ - `dial_code` (String): The international dialing code of the country.
38
+ - `flag` (String): The flag emoji of the country.
39
+
40
+ ### Example Country Object
41
+
42
+ ```json
43
+ {
44
+ "name": "Zambia",
45
+ "code": "ZM",
46
+ "dial_code": "+260",
47
+ "flag": "πŸ‡ΏπŸ‡²"
48
+ }
49
+ ```
50
+
51
+ ## Contributing
52
+
53
+ Contributions are welcome! Please open an issue or submit a pull request for any bugs or features.
54
+
55
+ 1. Fork the repository
56
+ 2. Create a new branch (`git checkout -b feature-branch`)
57
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
58
+ 4. Push to the branch (`git push origin feature-branch`)
59
+ 5. Open a pull request
60
+
61
+ ## License
62
+
63
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
64
+
65
+ ## Acknowledgements
66
+
67
+ - Thank you to everyone who has contributed to this project.
68
+
69
+ [npm-image]: https://img.shields.io/npm/v/countries-api-json.svg?style=flat-square
70
+ [npm-url]: https://www.npmjs.com/package/countries-api-json
71
+ [npm-downloads]: https://img.shields.io/npm/dm/countries-api-json.svg?style=flat-square
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "countries-api-json",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A comprehensive package providing detailed information about countries in a structured JSON format.",
5
5
  "main": "index.js",
6
6
  "scripts": {