Skip to content

Commit

Permalink
Refactor example documentation structure and add CacheableLookup exam…
Browse files Browse the repository at this point in the history
…ple (#3363)
  • Loading branch information
DarkGL authored Jun 24, 2024
1 parent 59fc6d5 commit dd98299
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
})
```

0 comments on commit dd98299

Please sign in to comment.