countries-api-json 1.0.0 β 1.0.2
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.
- package/README.md +71 -0
- package/package.json +7 -3
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.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A comprehensive package providing detailed information about countries in a structured JSON format.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "
|
|
11
|
+
"url": "https://github.com/yash-chandnani/countries-api-json"
|
|
12
12
|
},
|
|
13
13
|
"keywords": [
|
|
14
14
|
"countries",
|
|
@@ -17,7 +17,11 @@
|
|
|
17
17
|
"flags",
|
|
18
18
|
"mobile-codes",
|
|
19
19
|
"JSON",
|
|
20
|
-
"ISO-code"
|
|
20
|
+
"ISO-code",
|
|
21
|
+
"country-json",
|
|
22
|
+
"country-data",
|
|
23
|
+
"world-countries",
|
|
24
|
+
"country-flags"
|
|
21
25
|
],
|
|
22
26
|
"author": "yash-chandnani",
|
|
23
27
|
"license": "ISC"
|