{"id":15686988,"url":"https://github.com/webistomin/posthtml-link-noreferrer","last_synced_at":"2025-08-16T02:06:51.800Z","repository":{"id":35011465,"uuid":"185440591","full_name":"webistomin/posthtml-link-noreferrer","owner":"webistomin","description":":lock: PostHTML plugin to make secure links","archived":false,"fork":false,"pushed_at":"2023-01-07T07:33:34.000Z","size":1075,"stargazers_count":9,"open_issues_count":12,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-12T08:42:15.209Z","etag":null,"topics":["link","nofollow","noopener","noreferrer","post-processing","posthtml-link-noreferrer"],"latest_commit_sha":null,"homepage":"https://mathiasbynens.github.io/rel-noopener/","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/webistomin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["webistomin"]}},"created_at":"2019-05-07T16:32:58.000Z","updated_at":"2023-03-25T11:16:14.000Z","dependencies_parsed_at":"2023-01-15T11:58:00.882Z","dependency_job_id":null,"html_url":"https://github.com/webistomin/posthtml-link-noreferrer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/webistomin/posthtml-link-noreferrer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webistomin%2Fposthtml-link-noreferrer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webistomin%2Fposthtml-link-noreferrer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webistomin%2Fposthtml-link-noreferrer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webistomin%2Fposthtml-link-noreferrer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webistomin","download_url":"https://codeload.github.com/webistomin/posthtml-link-noreferrer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webistomin%2Fposthtml-link-noreferrer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270657715,"owners_count":24623465,"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","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["link","nofollow","noopener","noreferrer","post-processing","posthtml-link-noreferrer"],"created_at":"2024-10-03T17:42:19.954Z","updated_at":"2025-08-16T02:06:51.779Z","avatar_url":"https://github.com/webistomin.png","language":"JavaScript","funding_links":["https://github.com/sponsors/webistomin"],"categories":[],"sub_categories":[],"readme":"# posthtml-link-noreferrer \u003cimg align=\"right\" width=\"220\" height=\"200\" title=\"PostHTML logo\" src=\"http://posthtml.github.io/posthtml/logo.svg\"\u003e\n\n[![NPM][npm]][npm-url]\n![npm](https://img.shields.io/npm/dt/posthtml-link-noreferrer.svg)\n[![Deps][deps]][deps-url]\n[![DevDeps][dev-deps]][dev-deps-url]\n[![Build][build]][build-badge]\n\nThis plugin add `rel=\"noopener\"` and `rel=\"noreferrer\"` to all links that contain the attribute `target=\"_blank\"`.\n\nRead more about problem in [google blog](https://developers.google.com/web/tools/lighthouse/audits/noopener).\n\n**⭐️ Star me on GitHub — it helps!**\n\n**Before:**\n``` html\n\u003ca href=\"/\" target=\"_blank\"\u003eExternal link\u003c/a\u003e\n\u003ca href=\"/\" target=\"_blank\" rel=\"nofollow\"\u003eExternal link\u003c/a\u003e\n\u003ca href=\"/\" target=\"_self\"\u003eHome\u003c/a\u003e\n```\n\n**After:**\n``` html\n\u003ca href=\"/\" target=\"_blank\" rel=\"noopener noreferrer\"\u003eExternal link\u003c/a\u003e\n\u003ca href=\"/\" target=\"_blank\" rel=\"nofollow\"\u003eExternal link\u003c/a\u003e\n\u003ca href=\"/\" target=\"_self\"\u003eHome\u003c/a\u003e\n```\n\n## Demo\n[**DEMO**](https://mathiasbynens.github.io/rel-noopener/)\n\n## Install\n\n```npm\nnpm i posthtml-link-noreferrer --save-dev\n```\n\n## Usage\n\n### Gulp\n```npm\nnpm i gulp-posthtml posthtml-link-noreferrer --save-dev\n```\n\n```js\nconst gulp = require('gulp');\nconst postHTML = require('gulp-posthtml');\nconst postHTMLNoRef = require('posthtml-link-noreferrer');\n\nconst config = () =\u003e ({\n  plugins: [\n    postHTMLNoRef({\n      attr: ['noopener', 'noreferrer']\n    }),\n  ],\n});\n\ngulp.task('posthtml', () =\u003e gulp.src('./build/*.html')\n  .pipe(postHTML(config))\n  .pipe(gulp.dest('./build')));\n```\n\n### Webpack\n```npm\nnpm i html-loader posthtml-loader posthtml-link-noreferrer  --save-dev\n```\n\n```js\nmodule: {\n  rules: [\n    {\n      test: /\\.html$/,\n      use: [\n        'html-loader',\n        {\n          loader: 'posthtml-loader',\n          options: {\n            plugins: [\n              require('posthtml-link-noreferrer')({\n                attr: ['noopener', 'noreferrer']\n              })\n            ]\n          }\n        }\n      ]\n    }\n  ]\n}\n```\n\n## Options\n\n| Option | Type | description | Possible subsets | Default value |\n| ------ | ------ | ------ | ------ | ------ |\n attr | `array` | Describes rel attributes. | `'noopener'`, `'noreferrer'`, `'nofollow'` | `'noopener', 'noreferrer'` |\n\n---\n### Contributing\n\nSee [PostHTML Guidelines](https://github.com/posthtml/posthtml/tree/master/docs) and [contribution guide](CONTRIBUTING.md).\n\n### License [MIT](LICENSE)\n\n[npm]: https://img.shields.io/npm/v/posthtml-link-noreferrer.svg\n[npm-url]: https://npmjs.com/package/posthtml-link-noreferrer\n\n[deps]: https://david-dm.org/posthtml/posthtml.svg\n[deps-url]: https://david-dm.org/webistomin/posthtml-link-noreferrer\n\n[dev-deps]: https://david-dm.org/webistomin/posthtml-link-noreferrer/dev-status.svg\n[dev-deps-url]: https://david-dm.org/webistomin/posthtml-link-noreferrer?type=dev\n\n[style]: https://img.shields.io/badge/code%20style-standard-yellow.svg\n[style-url]: http://standardjs.com/\n\n[build]: https://github.com/webistomin/posthtml-link-noreferrer/actions/workflows/ci.yml/badge.svg\n[build-badge]: https://github.com/webistomin/posthtml-link-noreferrer/actions/workflows/ci.yml\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebistomin%2Fposthtml-link-noreferrer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebistomin%2Fposthtml-link-noreferrer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebistomin%2Fposthtml-link-noreferrer/lists"}