Skip to content

Commit dd98299

Browse files
authored
Refactor example documentation structure and add CacheableLookup example (nodejs#3363)
1 parent 59fc6d5 commit dd98299

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/examples/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,18 @@ async function deleteRequest (port = 3001) {
125125
}
126126
}
127127
```
128+
129+
## Cacheable DNS Lookup
130+
131+
### Using CacheableLookup to cache DNS lookups in undici
132+
133+
```js
134+
import { Agent } from 'undici'
135+
import CacheableLookup from 'cacheable-lookup';
136+
137+
const cacheable = new CacheableLookup(opts)
138+
139+
const agent = new Agent({
140+
connect: { lookup: cacheable.lookup }
141+
})
142+
```

0 commit comments

Comments
 (0)