Skip to content

Commit 530854b

Browse files
committed
update README.md
1 parent 125420e commit 530854b

File tree

1 file changed

+12
-20
lines changed

1 file changed

+12
-20
lines changed

README.md

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -175,50 +175,46 @@ When looking up an IP address, the response object includes `response.country` w
175175
```typescript
176176
import IPinfoWrapper, { IPinfo } from "node-ipinfo";
177177

178-
// Countries Names: In-memory map
179178
const countries = {
180179
"US": "United States",
181180
"FR": "France",
182181
"BD": "Bangladesh",
183182
...
184183
}
185184

186-
// Countries Flags: In-memory map
187185
const countriesFlags = {
188186
"US": {"emoji": "🇺🇸","unicode": "U+1F1FA U+1F1F8"},
189187
"AD": {"emoji": "🇦🇩", "unicode": "U+1F1E6 U+1F1E9"},
190188
"AE": {"emoji": "🇦🇪", "unicode": "U+1F1E6 U+1F1EA"},
191189
...
192190
}
193191

194-
// Countries Currencies: In-memory map
195192
const countriesCurrencies = {
196193
"US" : { "code": "USD" ,"symbol": "$"},
197194
"AD": {"code": "EUR", "symbol": ""},
198195
"AE": {"code": "AED", "symbol": "د.إ"},
199196
...
200197
}
201198

202-
// Continents: In-memory map
203199
const continents = {
204200
"US": {"code": "NA", "name": "North America"},
205201
"BD": {"code": "AS", "name": "Asia"},
206202
"BE": {"code": "EU", "name": "Europe"},
207203
...
208204
}
209205

210-
// EU Countries: In-memory map
211206
const euCountries = ["FR","ES","BE", ...]
212207

213208
const ipinfoWrapper = new IPinfoWrapper(
214209
"MY_TOKEN",
215210
undefined,
216211
undefined,
217-
countries,
218-
countriesFlags,
219-
countriesCurrencies,
220-
continents,
221-
euCountries
212+
{
213+
countries: countries,
214+
countriesFlags: countriesFlags,
215+
countriesCurrencies: countriesCurrencies,
216+
...
217+
}
222218
);
223219

224220
ipinfoWrapper.lookupIp("1.1.1.1").then((response: IPinfo) => {
@@ -250,50 +246,46 @@ ipinfoWrapper.lookupIp("1.1.1.1").then((response: IPinfo) => {
250246
```javascript
251247
const { IPinfoWrapper } = require("node-ipinfo");
252248

253-
// Countries Names: In-memory map
254249
const countries = {
255250
"US": "United States",
256251
"FR": "France",
257252
"BD": "Bangladesh",
258253
...
259254
}
260255

261-
// Countries Flags: In-memory map
262256
const countriesFlags = {
263257
"US": {"emoji": "🇺🇸","unicode": "U+1F1FA U+1F1F8"},
264258
"AD": {"emoji": "🇦🇩", "unicode": "U+1F1E6 U+1F1E9"},
265259
"AE": {"emoji": "🇦🇪", "unicode": "U+1F1E6 U+1F1EA"},
266260
...
267261
}
268262

269-
// Countries Currencies: In-memory map
270263
const countriesCurrencies = {
271264
"US" : { "code": "USD" ,"symbol": "$"},
272265
"AD": {"code": "EUR", "symbol": ""},
273266
"AE": {"code": "AED", "symbol": "د.إ"},
274267
...
275268
}
276269

277-
// Continents: In-memory map
278270
const continents = {
279271
"US": {"code": "NA", "name": "North America"},
280272
"BD": {"code": "AS", "name": "Asia"},
281273
"BE": {"code": "EU", "name": "Europe"},
282274
...
283275
}
284276

285-
// EU Countries: In-memory map
286277
const euCountries = ["FR","ES","BE", ...]
287278

288279
const ipinfo = new IPinfoWrapper(
289280
"MY_TOKEN",
290281
undefined,
291282
undefined,
292-
countries,
293-
countriesFlags,
294-
countriesCurrencies,
295-
continents,
296-
euCountries
283+
{
284+
countries: countries,
285+
countriesFlags: countriesFlags,
286+
countriesCurrencies: countriesCurrencies,
287+
...
288+
}
297289
);
298290

299291
ipinfo.lookupIp("1.1.1.1").then((response) => {

0 commit comments

Comments
 (0)