{"_id":"posthtml-urls","_rev":"3-ff44d6cf34060a7d2331b86e0933ba07","name":"posthtml-urls","description":"PostHTML plugin for transforming URLs.","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"posthtml-urls","description":"PostHTML plugin for transforming URLs.","version":"1.0.0","license":"MIT","author":{"name":"Steven Vachon","email":"contact@svachon.com","url":"https://www.svachon.com/"},"main":"lib","repository":{"type":"git","url":"git+https://github.com/posthtml/posthtml-urls.git"},"dependencies":{"http-equiv-refresh":"^1.0.0","list-to-array":"^1.1.0","parse-srcset":"^1.0.2","promise-each":"^2.2.0"},"devDependencies":{"chai":"^3.5.0","mocha":"^3.2.0","posthtml":"~0.9.1"},"engines":{"node":">= 4"},"scripts":{"test":"mocha test --reporter spec --check-leaks --bail"},"files":["lib"],"keywords":["posthtml","posthtml-plugin","url"],"gitHead":"307c91342a211b3f9fb22bc57264bbb31f235fbb","bugs":{"url":"https://github.com/posthtml/posthtml-urls/issues"},"homepage":"https://github.com/posthtml/posthtml-urls#readme","_id":"posthtml-urls@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.1.4","_npmUser":{"name":"zachleat","email":"zachleatherman@gmail.com"},"dist":{"integrity":"sha512-CMJ0L009sGQVUuYM/g6WJdscsq6ooAwhUuF6CDlYPMLxKp2rmCYVebEU+wZGxnQstGJhZPMvXsRhtqekILd5/w==","shasum":"3102d7b9e5c2fbdf19c8ec7ca825600dad3b9164","tarball":"https://registry.npmjs.org/posthtml-urls/-/posthtml-urls-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICOOdTIhy07etPIhcVEjRoFF6WzAM7+9uvIbQfh4PHRxAiAnMan7U5oX9oEPotwUOx4KWzXVhbwhBzzknvVMBfzHjw=="}]},"maintainers":[{"name":"zachleat","email":"zachleatherman@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/posthtml-urls-1.0.0.tgz_1517080179146_0.41944728628732264"},"directories":{}}},"readme":"# posthtml-urls [![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][david-image]][david-url]\n> PostHTML plugin for transforming URLs.\n\n\n## Installation\n\n[Node.js](http://nodejs.org/) `>= 4` 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: function(url, attr, element) {\n    return `http://domain.com/${url}`;\n  }\t\n};\n\nposthtml()\n.use( urls(options) )\n.process('<a href=\"link.html\">link</a>')\n.then(result => console.log(result.html));\n\n//-> <a href=\"http://domain.com/link.html\">link</a>\n```\n\n\n## Options\n\n### `options.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### `options.filter`\nType: `Object`  \nDefault value: […](https://github.com/posthtml/posthtml-urls/blob/master/lib/defaultOptions.js#L5-L29)  \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 `<style>` 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.org/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[david-image]: https://img.shields.io/david/posthtml/posthtml-urls.svg\n[david-url]: https://david-dm.org/posthtml/posthtml-urls","maintainers":[{"email":"contact@svachon.com","name":"stevenvachon"}],"time":{"modified":"2022-05-13T07:09:23.276Z","created":"2018-01-27T19:09:40.029Z","1.0.0":"2018-01-27T19:09:40.029Z"},"homepage":"https://github.com/posthtml/posthtml-urls#readme","keywords":["posthtml","posthtml-plugin","url"],"repository":{"type":"git","url":"git+https://github.com/posthtml/posthtml-urls.git"},"author":{"name":"Steven Vachon","email":"contact@svachon.com","url":"https://www.svachon.com/"},"bugs":{"url":"https://github.com/posthtml/posthtml-urls/issues"},"license":"MIT","readmeFilename":"README.md"}