country-data-filter 1.0.17 → 1.0.18
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 +104 -63
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,52 +15,60 @@ JavaScript
|
|
|
15
15
|
javascript
|
|
16
16
|
Copy code
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
```js
|
|
19
19
|
const {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
} = require(
|
|
20
|
+
getDataByCountry,
|
|
21
|
+
getDataByProvince,
|
|
22
|
+
getDataByDistrict,
|
|
23
|
+
getDataByCity,
|
|
24
|
+
getDataByCountryProvince,
|
|
25
|
+
getDataByCountryProvinceDistrict,
|
|
26
|
+
getDataByCountryProvinceDistrictCity,
|
|
27
|
+
getDataByEtherCountryProvinceDistrictCity,
|
|
28
|
+
getDataByCountryDistrict,
|
|
29
|
+
getDataByCountryCity,
|
|
30
|
+
getDataByProvinceDistrict,
|
|
31
|
+
getDataByProvinceCity,
|
|
32
|
+
getDataByDistrictCity,
|
|
33
|
+
getCurrencyByCountry,
|
|
34
|
+
getDataByPostalCode,
|
|
35
|
+
listFunctions,
|
|
36
|
+
} = require("country-data-filter");
|
|
37
|
+
```
|
|
37
38
|
|
|
38
39
|
TypeScript
|
|
39
40
|
typescript
|
|
40
41
|
Copy code
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
42
|
+
|
|
43
|
+
```js
|
|
44
|
+
import {
|
|
45
|
+
getDataByCountry,
|
|
46
|
+
getDataByProvince,
|
|
47
|
+
getDataByDistrict,
|
|
48
|
+
getDataByCity,
|
|
49
|
+
getDataByCountryProvince,
|
|
50
|
+
getDataByCountryProvinceDistrict,
|
|
51
|
+
getDataByCountryProvinceDistrictCity,
|
|
52
|
+
getDataByEtherCountryProvinceDistrictCity,
|
|
53
|
+
getDataByCountryDistrict,
|
|
54
|
+
getDataByCountryCity,
|
|
55
|
+
getDataByProvinceDistrict,
|
|
56
|
+
getDataByProvinceCity,
|
|
57
|
+
getDataByDistrictCity,
|
|
58
|
+
getCurrencyByCountry,
|
|
59
|
+
getDataByPostalCode,
|
|
60
|
+
listFunctions,
|
|
61
|
+
} from "country-data-filter";
|
|
62
|
+
```
|
|
59
63
|
|
|
60
64
|
javascript
|
|
61
65
|
Copy code
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
|
|
67
|
+
```js
|
|
68
|
+
const result = getDataByCountry(countryCode);
|
|
69
|
+
console.log(result);
|
|
70
|
+
```
|
|
71
|
+
|
|
64
72
|
Returns a list of provinces, districts, and cities for a given country code.
|
|
65
73
|
|
|
66
74
|
Parameters:
|
|
@@ -71,8 +79,12 @@ An object containing sorted arrays of provinces, districts, and cities, or an er
|
|
|
71
79
|
|
|
72
80
|
javascript
|
|
73
81
|
Copy code
|
|
74
|
-
|
|
75
|
-
|
|
82
|
+
|
|
83
|
+
```js
|
|
84
|
+
const result = getDataByDistrict(districtName);
|
|
85
|
+
console.log(result);
|
|
86
|
+
```
|
|
87
|
+
|
|
76
88
|
Returns the country code, province, and cities for a given district name.
|
|
77
89
|
|
|
78
90
|
Parameters:
|
|
@@ -83,8 +95,12 @@ An object containing the country code, province name, and list of cities, or an
|
|
|
83
95
|
|
|
84
96
|
javascript
|
|
85
97
|
Copy code
|
|
86
|
-
|
|
87
|
-
|
|
98
|
+
|
|
99
|
+
```js
|
|
100
|
+
const result = getDataByProvince(provinceName);
|
|
101
|
+
console.log(result);
|
|
102
|
+
```
|
|
103
|
+
|
|
88
104
|
Returns the list of districts and cities for a given province name.
|
|
89
105
|
|
|
90
106
|
Parameters:
|
|
@@ -95,8 +111,12 @@ An object containing the list of districts and cities, or an error message if th
|
|
|
95
111
|
|
|
96
112
|
javascript
|
|
97
113
|
Copy code
|
|
98
|
-
|
|
99
|
-
|
|
114
|
+
|
|
115
|
+
```js
|
|
116
|
+
const result = listFunctions();
|
|
117
|
+
console.log(result);
|
|
118
|
+
```
|
|
119
|
+
|
|
100
120
|
Returns a list of all available functions in the package.
|
|
101
121
|
|
|
102
122
|
Returns:
|
|
@@ -104,8 +124,11 @@ An object containing the filtered data list.
|
|
|
104
124
|
|
|
105
125
|
javascript
|
|
106
126
|
Copy code
|
|
107
|
-
|
|
108
|
-
|
|
127
|
+
|
|
128
|
+
```js
|
|
129
|
+
const result = getDataByEtherCountryProvinceDistrictCity();
|
|
130
|
+
console.log(result);
|
|
131
|
+
```
|
|
109
132
|
|
|
110
133
|
Parameters:
|
|
111
134
|
countryCode (string)?: The code of the country.
|
|
@@ -120,22 +143,34 @@ list of functions
|
|
|
120
143
|
|
|
121
144
|
javascript
|
|
122
145
|
Copy code
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
146
|
+
|
|
147
|
+
```js
|
|
148
|
+
getDataByCountry(countryCode); // countryCode: string
|
|
149
|
+
getDataByProvince(provinceName); // provinceName: string
|
|
150
|
+
getDataByDistrict(districtName); // districtName: string
|
|
151
|
+
getDataByCity(cityName); // cityName: string
|
|
152
|
+
getDataByCountryProvince(countryCode, provinceName); // countryCode: string, provinceName: string
|
|
153
|
+
getDataByCountryProvinceDistrict(countryCode, provinceName, districtName); // countryCode: string, provinceName: string, districtName: string
|
|
154
|
+
getDataByCountryProvinceDistrictCity(
|
|
155
|
+
countryCode,
|
|
156
|
+
provinceName,
|
|
157
|
+
districtName,
|
|
158
|
+
cityName
|
|
159
|
+
); // countryCode: string, provinceName: string, districtName: string, cityName: string
|
|
160
|
+
getDataByEtherCountryProvinceDistrictCity(
|
|
161
|
+
countryCode,
|
|
162
|
+
provinceName,
|
|
163
|
+
districtName,
|
|
164
|
+
cityName
|
|
165
|
+
); // countryCode: string, provinceName: string, districtName: string, cityName: string
|
|
166
|
+
getDataByCountryDistrict(countryCode, districtName); // countryCode: string, districtName: string
|
|
167
|
+
getDataByCountryCity(countryCode, cityName); // countryCode: string, cityName: string
|
|
168
|
+
getDataByProvinceDistrict(provinceName, districtName); // provinceName: string districtName: string
|
|
169
|
+
getDataByProvinceCity(provinceName, cityName); // provinceName: string, cityName: string
|
|
170
|
+
getDataByDistrictCity(districtName, cityName); // districtName: string, cityName: string
|
|
171
|
+
getCurrencyByCountry(countryCode); // countryCode: string
|
|
172
|
+
getDataByPostalCode(postalCode); // postalCode: string
|
|
173
|
+
```
|
|
139
174
|
|
|
140
175
|
Contributing
|
|
141
176
|
If you want to contribute to this project, please follow these steps:
|
|
@@ -150,4 +185,10 @@ This project is licensed under the MIT License. See the LICENSE file for details
|
|
|
150
185
|
Contact
|
|
151
186
|
For any questions or support, please contact knnadeera1@gmail.com.
|
|
152
187
|
|
|
153
|
-
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
```
|