# `@11ty/posthtml-urls`
> [!NOTE]
> This package source code has moved to [`eleventy-utils`](https://github.com/11ty/eleventy-utils/tree/main/posthtml-urls).
PostHTML plugin for transforming URLs. This is a fork of [`posthtml/posthtml-urls`](https://github.com/posthtml/posthtml-urls).
## Installation
[Node.js](http://nodejs.org) `>= 22.12` is required. To install, type this at the command line:
```shell
npm install @11ty/posthtml-urls
```
## Usage
```js
import posthtml from 'posthtml';
import urls from '@11ty/posthtml-urls';
const options = {
// rawNode added in v1.0.3
eachURL: (url, attr, tagName, rawNode) => `http://domain.com/${url}`
};
posthtml()
.use( urls(options) )
.process('link')
.then(result => console.log(result.html));
//-> link
```
## Options
### `eachURL`
Type: `Function`
Default value: `undefined`
A callback function ran for each URL value found. You can return either a synchronous value or a `Promise`. The `rawNode` argument was added in `v1.0.3`.
### `filter`
Type: `Object`
Default value: [`{…}`](https://github.com/posthtml/posthtml-urls/blob/master/lib/defaultOptions.js)
The elements and attributes for which to search. An attribute value can optionally be a function, for deeper filtering.
## FAQ
1. **How can I filter `