npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

w3validator

v1.1.1

Published

W3C HTML validator for Node.js - validate HTML from URLs using W3C validator

Downloads

37

Readme

W3C HTML Validator for Node.js

Validate HTML code from your URLs using the W3C HTML validator. This package automatically checks your HTML pages using W3C's official validator.

🚀 Installation

Global Installation (recommended for CLI usage)

npm install -g w3validator

Now you can use the w3 command from anywhere!

Local Installation (for programmatic usage)

npm install w3validator
npx w3 /path/to/routeList.json

To uninstall:

npm uninstall -g w3validator

📋 Features

  • ✅ Uses official W3C validator
  • 🔄 Automatic retry mechanism
  • 📊 Detailed error reports
  • 🎯 Multiple URL support

⚙️ Usage

CLI Usage

  1. First, create a routeList.json file. You can do this manually, or quickly generate a ready-to-use template by running the following command:
npx w3 create-template

This command will create a file with the following structure:

{
  "routeList": [
    "http://example.com",
    "http://example.com/about",
    "http://example.com/contact"
  ]
}
  1. After global installation, run from any directory:
w3 /path/to/routeList.json

Example Route List File

{
  "routeList": [
    "http://127.0.0.1:8000/",
    "http://127.0.0.1:8000/category1",
    "http://127.0.0.1:8000/category2",
    "http://127.0.0.1:8000/author",
    "http://127.0.0.1:8000/search"
  ]
}

📊 Output Example

[1/5] Validating: http://127.0.0.1:8000/
================================================================================
HTML fetched (15234 characters)
Validation attempt 1 started...
W3 validation completed successfully

=== VALIDATION RESULTS ===

[1] Error (error)
Message: Element "div" not allowed as child of element "span"
Location: Line 45:12 to Line 45:16
Extract: <span><div class="content">
---

[2] Warning (warning)
Message: Consider using the "h1" element as a top-level heading
Location: Line 120:5 to Line 120:9
Extract: <h2>Welcome</h2>
---

================================================================================
Validation completed for all routes!

🛠️ Technologies

  • TypeScript
  • Node.js
  • W3C HTML Validator
  • JSDOM (HTML parsing)
  • Vite (bundler)

🔗 Useful Links