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 🙏

© 2026 – Pkg Stats / Ryan Hefner

markup-validator

v0.2.1

Published

Check the markup validity of HTML, CSS and SVG files using the W3C validator

Downloads

407

Readme

markup-validator

Check the markup validity of HTML, CSS and SVG files using the W3C validator

License: MIT ESM-only package Conventional Commits 1.0.0 Checked with Biome Released with release-change NPM latest version Node support Build status

markup-validator takes HTML, CSS and SVG files and returns detailed validation results.

Installation

Install package for Node.js:

pnpm add --save-dev markup-validator

You can also install it using npm:

npm install --save-dev markup-validator

Usage

Options

files

Type: array
CLI arguments: -f <space-separated list of files>, --files <space-separated list of files>

Specifies which files to be sent to validation. This option takes precedence over the other options.

paths

Type: array
CLI arguments: -p <space-separated list of paths>, --paths <space-separated list of paths>

Specifies which folders or files to be sent to validation. When omitted, all files are validated (skipping the node_modules folder), unless the exclude option is specified.

exclude

Type: array CLI arguments: -e <space-separated list of paths>, --exclude <space-separated list of paths>

Lists strings to match in paths to skip. When omitted, all files specified by files options if defined (all files otherwise) are validated (skipping the node_modules folder).

languages

Type: array
Default: ["html", "css", "svg"] CLI arguments: -l <space-separated list of languages>, --languages <space-separated list of languages>

Specifies which languages to validate. When omitted, all languages are validated.

dryRun

Type: boolean
Default: false CLI arguments: -d, --dry-run

Bypasses the validation (for usage while building CI).

ignoreLevel

Type: "info", "warning" or null
Default: null
CLI arguments: -i <level>, --ignore-level <level>

Skips unwanted messages. When set to "warning", both the "info" level and the "warning" level are skipped.

CLI

markup-validator can be used as a CLI tool.

markup-validator [flags]

package.json scripts

You can run markup-validator from the scripts section of your package.json file.

{
  "scripts": {
    "validate-html": "markup-validator --languages html",
    "one-folder": "markup-validator --paths docs",
    "one-file": "markup-validator --files docs/index.html",
    "all-files": "markup-validator"
  }
}

Examples

  • markup-validator: validates all HTML, CSS and SVG files in the project;
  • markup-validator --paths docs --exclude build tmp: validates all HTML, CSS and SVG files in the docs/ folder, except files which have build or tmp anywhere in their pathname or filename;
  • markup-validator --files docs/index.html docs/style.css docs/icon.svg: validates only the specified files;
  • markup-validator --languages html css: validates only HTML and CSS files in the project.

Application code

In addition to the CLI interface, markup-validator can be imported and called in ESM and TypeScript projects.

import { MarkupValidator } from "markup-validator";

const options = { files: ["docs/index.html"] };
const validator = new MarkupValidator(options);
const validate = await validator.validate();

Get help

Copyright & licence

© 2026 Victor Brito — Released under the MIT licence.