{"id":24983642,"url":"https://github.com/posthtml/posthtml-urls","last_synced_at":"2025-04-11T20:51:20.510Z","repository":{"id":47346307,"uuid":"76493723","full_name":"posthtml/posthtml-urls","owner":"posthtml","description":"PostHTML plugin for transforming URLs.","archived":false,"fork":false,"pushed_at":"2019-09-05T15:07:40.000Z","size":5,"stargazers_count":6,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-29T21:06:08.262Z","etag":null,"topics":["posthtml","posthtml-plugin","url"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/posthtml.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-14T20:19:06.000Z","updated_at":"2024-03-02T06:20:15.000Z","dependencies_parsed_at":"2022-07-21T14:48:26.032Z","dependency_job_id":null,"html_url":"https://github.com/posthtml/posthtml-urls","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-urls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-urls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-urls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-urls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posthtml","download_url":"https://codeload.github.com/posthtml/posthtml-urls/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247166815,"owners_count":20894797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["posthtml","posthtml-plugin","url"],"created_at":"2025-02-04T09:19:59.019Z","updated_at":"2025-04-11T20:51:20.485Z","avatar_url":"https://github.com/posthtml.png","language":"JavaScript","readme":"# posthtml-urls [![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url]\n\n\u003e PostHTML plugin for transforming URLs.\n\n\n## Installation\n\n[Node.js](http://nodejs.org) `\u003e= 6` is required. To install, type this at the command line:\n\n```shell\nnpm install posthtml-urls\n```\n\n\n## Usage\n\n```js\nconst posthtml = require('posthtml');\nconst urls = require('posthtml-urls');\n\nconst options = {\n  eachURL: (url, attr, element) =\u003e `http://domain.com/${url}`\n};\n\nposthtml()\n  .use( urls(options) )\n  .process('\u003ca href=\"link.html\"\u003elink\u003c/a\u003e')\n  .then(result =\u003e console.log(result.html));\n//-\u003e \u003ca href=\"http://domain.com/link.html\"\u003elink\u003c/a\u003e\n```\n\n\n## Options\n\n### `eachURL`\nType: `Function`  \nDefault value: `undefined`  \nA callback function ran for each URL value found. You can return either a synchronous value or a `Promise`.\n\n### `filter`\nType: `Object`  \nDefault value: [`{…}`](https://github.com/posthtml/posthtml-urls/blob/master/lib/defaultOptions.js)  \nThe elements and attributes for which to search. An attribute value can optionally be a function, for deeper filtering.\n\n\n## FAQ\n1. **How can I filter `\u003cstyle\u003e` elements and `style` attributes?**  \nUse [posthtml-postcss](https://npmjs.com/posthtml-postcss) and [postcss-url](https://npmjs.com/postcss-url).\n\n\n[npm-image]: https://img.shields.io/npm/v/posthtml-urls.svg\n[npm-url]: https://npmjs.com/package/posthtml-urls\n[travis-image]: https://img.shields.io/travis/posthtml/posthtml-urls.svg\n[travis-url]: https://travis-ci.org/posthtml/posthtml-urls\n[coveralls-image]: https://img.shields.io/coveralls/posthtml/posthtml-urls.svg\n[coveralls-url]: https://coveralls.io/github/posthtml/posthtml-urls\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthtml%2Fposthtml-urls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposthtml%2Fposthtml-urls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthtml%2Fposthtml-urls/lists"}