On this page
A broken README link can send users to the wrong documentation, an obsolete release, or an issue tracker that no longer accepts reports. Use this checklist to check links in an npm package README before release, including links whose destinations change through redirects.
This checklist focuses on the README that will ship, not just the file visible in your working tree. The hosting platform's current Markdown documentation and rendering behavior were not available to verify for this article; check those for your repository host and registry, and test the actual rendered views before publishing.
Key Takeaways
- Review links in the release candidate's README, including links hidden behind badges, images, and reference-style Markdown.
- Check both the initial URL and the final redirect destination; a successful response alone does not prove that the page is correct.
- Test relative links and anchors in the rendered repository and registry views. Do not assume they resolve identically.
- Inspect the package tarball and validate installation instructions in a disposable environment.
- Record any unresolved link or rendering issue before making the release public.
1. Inventory the links
Review the raw README and make a list of destinations, including inline links, reference definitions, linked images, and badges. For each link, note its purpose and expected destination. Then check these common categories:
- Repository: The project homepage and source links point to the intended repository and, where relevant, the intended branch or tag.
- Documentation: Guides, API references, examples, and migration instructions match the release being prepared. Check version selectors and links to specific sections.
- Installation: The package name and installation instructions match the intended registry and release. Check links to prerequisites and setup guides as well as commands.
- Issue reporting: Bug-report and feature-request links go to the project's intended tracker or submission form. Check whether instructions ask users to search existing issues or use a template.
- Downloads: Links to release pages, binaries, or archives point to the intended project and version, not an old release or an unrelated artifact.
- Other linked material: Review changelogs, licenses, contribution guides, badges, images, and external service links if present.
A useful review record has four columns: README text, URL as written, expected destination, and result. Assign a reviewer or follow-up to failures rather than silently dropping them.
Advertisement
2. Follow redirects and verify the destination
Open each public link and compare the final page with the expected project, version, and purpose. A link can return a successful response while landing on a generic homepage, a login page, or the wrong project's documentation.
For a command-line check, replace the example URL below with a public HTTPS URL from your README. These examples use curl; the first requests headers and follows redirects, while the second makes a GET request and reports the final URL and HTTP status.
curl -sSIL --max-redirs 5 --connect-timeout 5 --max-time 20 \
'https://example.com/'
curl -sSL -o /dev/null \
-w 'HTTP %{http_code}\nFinal URL: %{url_effective}\n' \
--max-redirs 5 --connect-timeout 5 --max-time 20 \
'https://example.com/'
Inspect the Location headers from the first command to understand the chain, and check the final URL from the second. Some sites handle HEAD requests differently from GET requests, so a failed header-only check warrants a GET and a browser review. A command-line success also does not establish that the page content is correct or that a browser can reach an anchor.
- Confirm the final hostname, project, and page are intentional.
- Check that a version-specific link reaches the intended version rather than silently switching to another release.
- Open the final page in a browser and verify the content and any section anchor.
- Treat authentication prompts, access-denied pages, rate limits, and timeouts as inconclusive until investigated.
- Update stale URLs when appropriate, while considering whether a redirect is intentionally maintained for compatibility.
Only follow URLs you trust, preferably from an isolated environment. Avoid sending private URLs or tokens to third-party link-checking services. Automated systems that accept arbitrary URLs need protections against requests to internal or otherwise prohibited destinations; a redirect checker alone is not a security boundary.
3. Check Markdown in every publication view
Consult the current Markdown documentation for your repository host and the package registry's README display. Then inspect the release candidate in the actual rendered views. This matters because a relative URL is interpreted against a base URL, and the base or rendering rules can differ between views.
- Relative file links: Open links such as
[Contributing](CONTRIBUTING.md)and./docs/setup.mdfrom the rendered repository README and the registry README. Confirm they reach the intended files in both contexts. - Relative images: Check images and linked badges as well as text links. Confirm that the image loads and that clicking a linked image goes to the intended destination.
- Anchors: Click table-of-contents links and links to headings on other pages. Check headings containing punctuation, formatting, duplicate text, or non-ASCII characters particularly carefully; generated anchor rules are platform-specific.
- Reference links: Verify that every reference label has the intended definition and that unused or duplicate definitions do not conceal mistakes.
- Markdown syntax: Inspect links containing parentheses, spaces, escaped characters, or nested formatting in the rendered page. A valid-looking source string may not render as intended.
- Release context: If documentation is versioned, check the README associated with the release tag or commit, not only the repository's default branch.
If a relative link works in the repository but not in the registry view, consider an absolute link to the intended public page. Decide whether it should follow the default branch or point to a release-specific location. After changing it, repeat the rendered checks.
Advertisement
4. Inspect the release package and test installation
From the package directory, use npm's packaging commands to inspect what is being prepared. Run these in a clean checkout of the release candidate, with the intended package configuration and dependencies in place:
npm pack --dry-run
npm pack
The first command previews the package contents; the second creates a tarball. Inspect the tarball listing and read its README to confirm that the packaged text contains your reviewed links. Replace the path below with the tarball produced by your command:
tar -tzf ./your-package.tgz
Use the listed README path when inspecting its contents; do not assume its capitalization or location without checking. Compare it with the source README and investigate any differences before release. The commands in this article were not executed here, so verify their behavior with your installed npm and tar versions.
Next, use a disposable project to exercise the README's installation instructions. For an unpublished candidate, install the generated tarball by its actual path; for an already published candidate, use the exact package name and version shown in your release plan. Check that the instructions identify the correct registry, version, prerequisites, and follow-up documentation. Package installation can run lifecycle scripts, so perform this only with code you trust and in an appropriately isolated environment.
Finally, inspect the registry-rendered README wherever your release workflow permits. If the registry view cannot be previewed before a public release, record that limitation, use a safe staging or candidate workflow if available, and verify the public view promptly after publication. Do not publish a candidate solely to test rendering without considering its visibility and your registry's publishing rules.
Common Mistakes
- Checking only HTTP status: A reachable URL may lead to the wrong project, version, or page.
- Testing only the repository view: Relative paths, images, and anchors still need a registry-view check.
- Ignoring the package artifact: The README in a tarball may differ from the file a reviewer inspected.
- Following a moving documentation link unintentionally: A link to current documentation may be appropriate, but it can also make an older release's instructions misleading.
- Treating an inaccessible page as healthy or broken without investigation: Authentication, rate limits, and network restrictions can obscure the result.
- Sending sensitive URLs to online tools: Query strings and paths can contain tokens or private information.
Best Practices
- Keep a short link inventory with the expected final destination and release version.
- Prefer stable, project-controlled destinations when they are available, and review external redirects periodically.
- Automate routine reachability checks where useful, but retain human review for page identity, version, anchors, and rendered Markdown.
- Repeat targeted checks after edits to headings, documentation paths, repository ownership, or release URLs.
- Make unresolved failures explicit in the release decision and assign follow-up work.
Conclusion
A useful README link audit checks the shipped artifact, the rendered views, and the destination users actually reach. Finish by validating installation instructions and resolving—or explicitly recording—any checks that could not be completed before release.
What would your domain sell for?
A free TidyURLs account unlocks the Domain Estimator. It prices a name from 191,011 real domain sales.