diff --git a/docs/examples/README.md b/docs/examples/README.md index a925459e40e..a8a14cfc150 100644 --- a/docs/examples/README.md +++ b/docs/examples/README.md @@ -125,3 +125,18 @@ async function deleteRequest (port = 3001) { } } ``` + +## Cacheable DNS Lookup + +### Using CacheableLookup to cache DNS lookups in undici + +```js +import { Agent } from 'undici' +import CacheableLookup from 'cacheable-lookup'; + +const cacheable = new CacheableLookup(opts) + +const agent = new Agent({ + connect: { lookup: cacheable.lookup } +}) +```