Registry / testing / remark-lint-no-dead-urls

remark-lint-no-dead-urls

JSON →
library2.0.1jsnpmunverified

A remark-lint rule that checks if URLs in Markdown files are alive by making HTTP requests, using the dead-or-alive library. Current stable version is 2.0.1 (February 2025), released under the unified collective with active maintenance. It differs from remark-validate-links by checking internet URLs rather than local file paths, and can also verify fragment IDs on web pages. ESM-only since v2, requires Node.js 18+.

npm install remark-lint-no-dead-urls
INSTALL
IMPORT
SIG · REMARK-LINT-NO-DEA
R
remark-lint-no-dead-urls
testingjavascriptv2.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

remarkLintNoDeadUrls
import remarkLintNoDeadUrls from 'remark-lint-no-dead-urls'
const remarkLintNoDeadUrls = require('remark-lint-no-dead-urls')
ESM-only since v2; CommonJS require does not work.
Options
import type {Options} from 'remark-lint-no-dead-urls'
import {Options} from 'remark-lint-no-dead-urls'
Options is a TypeScript type, use type import.
Default export
import remarkLintNoDeadUrls from 'remark-lint-no-dead-urls'
import {remarkLintNoDeadUrls} from 'remark-lint-no-dead-urls'
The package has a default export, not a named export.

Shows how to use the rule in a unified pipeline: parse markdown, lint for dead URLs, stringify, and report.

import remarkLintNoDeadUrls from 'remark-lint-no-dead-urls'; import remarkLint from 'remark-lint'; import remarkParse from 'remark-parse'; import remarkStringify from 'remark-stringify'; import {read} from 'to-vfile'; import {unified} from 'unified'; import {reporter} from 'vfile-reporter'; const file = await read('example.md'); await unified() .use(remarkParse) .use(remarkLint) .use(remarkLintNoDeadUrls, {skipLocalhost: true}) .use(remarkStringify) .process(file); console.error(reporter(file));
Debug
Known issues
breakingv2 drops CommonJS support entirely; package is ESM only.
fix
Use import instead of require().
affects: >=2.0.0
breakingv2 requires Node.js 18 or later.
fix
Update Node.js to version 18 or later.
affects: >=2.0.0
breakingOption renamed from gotOptions to deadOrAliveOptions.
fix
Replace gotOptions with deadOrAliveOptions in configuration.
affects: >=2.0.0
deprecatedThe option prefixUrl is replaced with from.
fix
Use options.from instead of options.gotOptions.prefixUrl.
affects: >=2.0.0
gotchaIf skipOffline is not set, the rule will throw an error when offline.
fix
Set skipOffline: true in options to allow offline runs.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'remark-lint-no-dead-urls'
Package not installed or wrong import path.
fix
Run `npm install remark-lint-no-dead-urls` and ensure you are using import (ESM).
TypeError: remarkLintNoDeadUrls is not a function
Using require() on an ESM-only package.
fix
Change const x = require('...') to import x from '...'.
Error: The `from` option is required for relative URLs
Relative URLs are present but no from option or file.data.meta.origin/pathname set.
fix
Provide options.from or set file.data.meta.origin and pathname.
Upgrade
Version history
2.0.1latest on npm
Audit
Dependencies
dead-or-aliverequiredunderlying library to check if URLs are reachable
remark-lintrequiredpeer dependency for the rule to work
Agent activity
14 hits · last 30 days
node
12
OpenAI (training)
2
Resources
remark-lint-no-dead-urls — npm install remark-lint-no-dead-urls · libregistry