{"name":"remark-lint-no-dead-urls","version":"2.0.0","keywords":["lint","markdown","remark-lint-rule","remark-lint","remark","rule"],"author":{"name":"David Clark","email":"david.dave.clark@gmail.com"},"license":"MIT","_id":"remark-lint-no-dead-urls@2.0.0","contributors":[{"name":"David Clark","email":"david.dave.clark@gmail.com"},{"url":"https://wooorm.com","name":"Titus Wormer","email":"tituswormer@gmail.com"}],"homepage":"https://github.com/remarkjs/remark-lint-no-dead-urls#readme","bugs":{"url":"https://github.com/remarkjs/remark-lint-no-dead-urls/issues"},"xo":{"prettier":true,"overrides":[{"files":["**/*.d.ts"],"rules":{"@typescript-eslint/ban-types":["error",{"extendDefaults":true}],"@typescript-eslint/array-type":["error",{"default":"generic"}],"@typescript-eslint/consistent-type-definitions":["error","interface"]}}]},"dist":{"shasum":"6d51ca2875086d7e748ca60cdbc2ed9577891ea7","tarball":"http://registry-npm.ywwl.com/remark-lint-no-dead-urls/download/remark-lint-no-dead-urls-2.0.0.tgz","fileCount":8,"integrity":"sha512-7kJ5rZ6fuuLt6iG2XS/uShVik0LYzshspZ/hNm/oPybXnJrehsYT31Y5AjeX57Mm7DAc7Q8EMSgeDiK/8SYYhQ==","signatures":[{"sig":"MEUCIGsX8eWzFPsaf7oorHtc5D4Pp4XatcX1JzG05WvfwOIgAiEA6c1AxgrvudykkiiqjHVb9BSD1b0bPXyXD9iLDdy9cOY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19294,"size":6765,"noattachment":false,"key":"/remark-lint-no-dead-urls/-/remark-lint-no-dead-urls-2.0.0.tgz"},"type":"module","types":"./index.d.ts","exports":"./index.js","funding":{"url":"https://opencollective.com/unified","type":"opencollective"},"gitHead":"c1365e1becd238b82c88804888e8f0ebdcd72abe","scripts":{"test":"npm run build && npm run format && npm run test-coverage","build":"tsc --build --clean && tsc --build && type-coverage","format":"remark . --frail --output --quiet && prettier . --log-level warn --write && xo --fix","prepack":"npm run build && npm run format","test-api":"node --conditions development test.js","test-coverage":"c8 --100 --reporter lcov npm run test-api"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"prettier":{"semi":false,"useTabs":false,"tabWidth":2,"singleQuote":true,"trailingComma":"none","bracketSpacing":false},"repository":{"url":"git+https://github.com/remarkjs/remark-lint-no-dead-urls.git","type":"git"},"_npmVersion":"10.8.3","description":"remark-lint rule to warn when URLs are dead","directories":{},"sideEffects":false,"_nodeVersion":"22.7.0","dependencies":{"vfile":"^6.0.0","devlop":"^1.0.0","is-online":"^11.0.0","@types/mdast":"^4.0.0","dead-or-alive":"^1.0.0","vfile-message":"^4.0.0","unist-util-visit":"^5.0.0","unified-lint-rule":"^3.0.0"},"remarkConfig":{"plugins":["remark-preset-wooorm"]},"typeCoverage":{"detail":true,"strict":true,"atLeast":100,"ignoreCatch":true},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.0.0","xo":"^0.59.0","remark":"^15.0.0","undici":"^6.0.0","prettier":"^3.0.0","remark-cli":"^12.0.0","typescript":"^5.0.0","vfile-sort":"^4.0.0","@types/node":"^22.0.0","type-coverage":"^2.0.0","remark-preset-wooorm":"^10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/remark-lint-no-dead-urls_2.0.0_1727450935286_0.7907195047365536","host":"s3://npm-registry-packages"},"readme":"# remark-lint-no-dead-urls\n\n[![Build][badge-build-image]][badge-build-url]\n[![Coverage][badge-coverage-image]][badge-coverage-url]\n[![Downloads][badge-downloads-image]][badge-downloads-url]\n[![Size][badge-size-image]][badge-size-url]\n[![Sponsors][badge-sponsors-image]][badge-collective-url]\n[![Backers][badge-backers-image]][badge-collective-url]\n[![Chat][badge-chat-image]][badge-chat-url]\n\n**[`remark-lint`][github-remark-lint]** rule to warn when URLs are dead.\n\n## Contents\n\n* [What is this?](#what-is-this)\n* [When should I use this?](#when-should-i-use-this)\n* [Install](#install)\n* [Use](#use)\n* [API](#api)\n  * [`Options`](#options)\n  * [`unified().use(remarkLintNoDeadUrls[, options])`](#unifieduseremarklintnodeadurls-options)\n* [Related](#related)\n* [Compatibility](#compatibility)\n* [Security](#security)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis lint rule checks whether URLs are alive or not.\n\n## When should I use this?\n\nYou can use this lint rule to check that URLs are alive.\n\nIt’s similar to [`remark-validate-links`][github-remark-validate-links],\nbut there’s an important difference.\nThat package checks the file system locally:\nwhether `path/to/example.md` exists.\nBut this package,\n`remark-lint-no-dead-urls`,\nchecks the internet:\nwhether `https://a.com` is alive,\n`/docs/example` is reachable on `https://mydomain.com`,\nand even whether certain IDs exist on a web page.\n\nThis package uses [`dead-or-alive`][github-dead-or-alive].\nYou can use it when you want to check URLs programmatically yourself.\n\n## Install\n\nThis package is [ESM only][github-gist-esm].\nIn Node.js (version 18+),\ninstall with [npm][npm-install]:\n\n```sh\nnpm install remark-lint-no-dead-urls\n```\n\nIn Deno with [`esm.sh`][esm-sh]:\n\n```js\nimport remarkLintNoDeadUrls from 'https://esm.sh/remark-lint-no-dead-urls@2'\n```\n\nIn browsers with [`esm.sh`][esm-sh]:\n\n```html\n<script type=\"module\">\n  import remarkLintNoDeadUrls from 'https://esm.sh/remark-lint-no-dead-urls@2?bundle'\n</script>\n```\n\n## Use\n\nOn the API:\n\n```js\nimport remarkLintNoDeadUrls from 'remark-lint-no-dead-urls'\nimport remarkLint from 'remark-lint'\nimport remarkParse from 'remark-parse'\nimport remarkStringify from 'remark-stringify'\nimport {read} from 'to-vfile'\nimport {unified} from 'unified'\nimport {reporter} from 'vfile-reporter'\n\nconst file = await read('example.md')\n\nawait unified()\n  .use(remarkParse)\n  .use(remarkLint)\n  .use(remarkLintNoDeadUrls)\n  .use(remarkStringify)\n  .process(file)\n\nconsole.error(reporter(file))\n```\n\nOn the CLI:\n\n```sh\nremark --frail --use remark-lint --use remark-lint-no-dead-urls .\n```\n\nOn the CLI in a config file (here a `package.json`):\n\n```diff\n …\n \"remarkConfig\": {\n   \"plugins\": [\n     …\n     \"remark-lint\",\n+    \"remark-lint-no-dead-urls\",\n     …\n   ]\n }\n …\n```\n\n## API\n\nThis package exports no identifiers.\nIt exports the additional [TypeScript][] type\n[`Options`][api-options].\nThe default export is\n[`remarkLintNoDeadUrls`][api-remark-lint-no-dead-urls].\n\n### `Options`\n\nConfiguration (TypeScript type).\n\n###### Fields\n\n* `deadOrAliveOptions` (`Options` from `dead-or-alive`, optional)\n  — options passed to `dead-or-alive`;\n  [`deadOrAliveOptions.findUrls`][github-dead-or-alive-options] is always off\n  as further URLs are not applicable\n* `from` (`string`, optional, example: `'https://example.com/from'`)\n  — check relative values relative to this URL;\n  you can also define this by setting `origin` and `pathname` in\n  `file.data.meta`\n* `skipLocalhost` (`boolean`, default: `false`)\n  — whether to ignore `localhost` links such as `http://localhost/*`,\n  `http://127.0.0.1/*`;\n  shortcut for a skip pattern of\n  `/^(https?:\\/\\/)(localhost|127\\.0\\.0\\.1)(:\\d+)?/`\n* `skipOffline` (`boolean`, default: `false`)\n  — whether to let offline runs pass quietly\n* `skipUrlPatterns` (`Array<RegExp | string>`, optional)\n  — list of patterns for URLs that should be skipped;\n  each URL will be tested against each pattern and will be ignored if\n  `new RegExp(pattern).test(url) === true`\n\n### `unified().use(remarkLintNoDeadUrls[, options])`\n\nWarn when URLs are dead.\n\n###### Notes\n\nTo improve performance,\ndecrease `maxRetries` in [`deadOrAliveOptions`][github-dead-or-alive-options]\nand/or decrease the value used for\n`sleep` in `deadOrAliveOptions`.\nThe normal behavior is to assume connections might be flakey and to sleep a\nwhile and retry a couple times.\n\nIf you do not care whether anchors exist and don’t need to support HTML\nredirects,\nyou can pass `checkAnchor: false` and `followMetaHttpEquiv: false` in\n[`deadOrAliveOptions`][github-dead-or-alive-options],\nwhich enables a fast path without parsing HTML.\n\n###### Parameters\n\n* `options` ([`Options`][api-options], optional)\n  — configuration\n\n###### Returns\n\nTransform (`(tree: Root, file: VFile) => Promise<Root>`).\n\n## Related\n\n* [`remark-lint`][github-remark-lint]\n  — markdown code style linter\n* [`remark-validate-links`][github-remark-validate-links]\n  — ensure local links work\n\n## Compatibility\n\nThis projects is compatible with maintained versions of Node.js.\n\nWhen we cut a new major release,\nwe drop support for unmaintained versions of Node.\nThis means we try to keep the current release line,\n`remark-lint-no-dead-urls@2`,\ncompatible with Node.js 18.\n\n## Security\n\nThis package can typically be considered safe.\nNote that this package checks URLs over the internet.\nDon’t use this if you consider that’s dangerous.\n\n## Contribute\n\nSee [`contributing.md`][health-contributing] in [`remarkjs/.github`][health]\nfor ways to get started.\nSee [`support.md`][health-support] for ways to get help.\n\nThis project has a [code of conduct][health-coc].\nBy interacting with this repository, organization, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][file-license] © [David Clark][github-david-clark]\n\n[api-remark-lint-no-dead-urls]: #unifieduseremarklintnodeadurls-options\n\n[api-options]: #options\n\n[badge-backers-image]: https://opencollective.com/unified/backers/badge.svg\n\n[badge-build-image]: https://github.com/remarkjs/remark-lint-no-dead-urls/actions/workflows/main.yml/badge.svg\n\n[badge-build-url]: https://github.com/remarkjs/remark-lint-no-dead-urls/actions\n\n[badge-collective-url]: https://opencollective.com/unified\n\n[badge-coverage-image]: https://img.shields.io/codecov/c/github/remarkjs/remark-lint-no-dead-urls.svg\n\n[badge-coverage-url]: https://codecov.io/github/remarkjs/remark-lint-no-dead-urls\n\n[badge-downloads-image]: https://img.shields.io/npm/dm/remark-lint-no-dead-urls.svg\n\n[badge-downloads-url]: https://www.npmjs.com/package/remark-lint-no-dead-urls\n\n[badge-size-image]: https://img.shields.io/bundlejs/size/remark-lint-no-dead-urls\n\n[badge-size-url]: https://bundlejs.com/?q=remark-lint-no-dead-urls\n\n[badge-sponsors-image]: https://opencollective.com/unified/sponsors/badge.svg\n\n[badge-chat-image]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[badge-chat-url]: https://github.com/remarkjs/remark/discussions\n\n[esm-sh]: https://esm.sh\n\n[file-license]: license\n\n[github-david-clark]: https://github.com/davidtheclark\n\n[github-dead-or-alive-options]: https://github.com/wooorm/dead-or-alive#options\n\n[github-dead-or-alive]: https://github.com/wooorm/dead-or-alive\n\n[github-gist-esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[github-remark-validate-links]: https://github.com/remarkjs/remark-validate-links\n\n[github-remark-lint]: https://github.com/remarkjs/remark-lint\n\n[health-coc]: https://github.com/remarkjs/.github/blob/main/code-of-conduct.md\n\n[health-contributing]: https://github.com/remarkjs/.github/blob/main/contributing.md\n\n[health-support]: https://github.com/remarkjs/.github/blob/main/support.md\n\n[health]: https://github.com/remarkjs/.github\n\n[npm-install]: https://docs.npmjs.com/cli/install\n\n[typescript]: https://www.typescriptlang.org\n","publish_time":1727450935476,"maintainers":[{"name":"remcohaszing","email":"remcohaszing@gmail.com"},{"name":"johno","email":"johnotander@gmail.com"},{"name":"wooorm","email":"tituswormer@gmail.com"}],"_cnpm_publish_time":1727450935476,"dist-tags":{"latest":"2.0.1"}}