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 🙏

© 2024 – Pkg Stats / Ryan Hefner

html-validator-cli

v7.0.1

Published

CLI for validating html using validator.w3.org/nu

Downloads

9,476

Readme

Build Status Coverage Status js-standard-style

html-validator-cli

CLI for validating html using validator.w3.org/nu

Requires Node >= 8.15.3 for older versions use v5.0.0

Sends Page is validto STDOUT and exits with code 0 if page is valid.

Sends Page is not valid to STDOUT and exits with code 1 if page is not valid.

Sends Page not found to STDOUT and exits with code 1 if page is not found.

Installation

$ npm i html-validator-cli -g

Usage

$ html-validator <url>

With file

$ html-validator --file=<path-to-file>

With data

$ html-validator --data=data

Optional pass in format for returned data.

Valid options: json, html, xhtml, xml, gnu and text (default).

$ html-validator <url> --format=gnu

Optional pass in another validator.

It needs to expose the same REST interface.

$ html-validator <url> --validator='http://html5.validator.nu'

Optional pass in strings to ignore

$ html-validator <url> --ignore='Error: Stray end tag “div”.' --ignore='Error: Stray end tag “body”.'

Optional pass in headers

$ html-validator <url> --headers='{"foo":"doo"}'

To get full result from validator use --verbose

$ html-validator <url> --verbose

Optional, only get errors use --quiet

$ html-validator <url> --quiet

Validate a local document without setting up a tunnel

$ html-validator <local-url> --islocal

returns array of error messages

[
  {
    "type": "error",
    "lastLine": 8,
    "lastColumn": 32,
    "firstColumn": 27,
    "message": "Stray end tag “div”.",
    "extract": "aaaad code</div></p>\n<",
    "hiliteStart": 10,
    "hiliteLength": 6
  }
]

Related

License

MIT