You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `lookup()` method accepts either positional arguments or a single named-params object.
92
+
85
93
The library will lookup the ip address of the host computer if no ip address is provided.
86
94
87
95
```js
@@ -92,35 +100,48 @@ ipdata.lookup()
92
100
});
93
101
```
94
102
95
-
You can pass an ip address as the first parameter to the `lookup()` method to lookup information about the ip address using IPData.
103
+
You can pass an ip address to lookupinformation about it.
96
104
97
105
```js
98
-
constip='1.1.1.1';
99
-
ipdata.lookup(ip)
106
+
ipdata.lookup('1.1.1.1')
100
107
.then(function(info) {
101
-
// info.ip === 1.1.1.1
108
+
// info.ip === '1.1.1.1'
102
109
// ...
103
110
});
104
111
```
105
112
106
-
You can specify only a select field to be returned when looking up an ip address by passing a field as the second parameter to the `lookup()` method.
113
+
You can specify a single field to be returned.
107
114
108
115
```js
109
-
constip='1.1.1.1';
110
-
constselectField='ip';
111
-
ipdata.lookup(ip, selectField)
116
+
ipdata.lookup('1.1.1.1', 'ip')
112
117
.then(function(info) {
113
-
// info.select_field === 1.1.1.1
118
+
// info.ip === '1.1.1.1'
114
119
// ...
115
120
});
116
121
```
117
122
118
-
You can specify only certain fields to be returned when looking up an ip address by passing an array of fields as the third parameter to the `lookup()` method.
0 commit comments