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

gulp-html-conformance

v2.0.1

Published

gulp plugin for checking out whether html files conform to the HTML spec (v.Nu checker) or your formatting preferences (htmlhint)

Downloads

1

Readme

License: MIT

Gulp-html-conformance

Gulp plugin for checking out whether html files conform to the HTML spec (with the help of v.Nu checker) or your formatting preferences (with the help of HTMLHint).

Prerequisites

  1. Node engine >= 8.2.0
  2. Gulp task runner
  3. The Nu Html Checker requires an environment with Java 8 or above. How to install on Windows, Mac OS & Ubuntu

Installing

npm i -D gulp-html-conformance

Usage

This plugin supports a lot of options for Nu Checker and HTMLHint, but you can also use it without any options, in which case the default options will be used. See options for v.Nu See options for HTMLHint Default rulesset for HTMLHint :no_entry_sign: Please, do not mix the compilation process with the linting. Any lint tool in such a case needs a final compilation result. The gulp pipes look like they are performed synchronously, but this is not so! Do not do this.. Do this instead..:thumbsup:

Examples

1.Without options:
const gulp = require('gulp');
const conform = require('gulp-html-conformance');

gulp.task('lintHtml', () =>
  gulp
    .src('./src/*.html')
    .pipe(conform())
    .pipe(gulp.dest('./dest'))
);
2. With options:
// Example for options object.
// This object can contain three top-level keys and any of them can be omitted.
{
  logToFile: './pathtologfile',
  vnu:{
   // ... v.Nu options here
  },
  htmlhint:{
    // ... HTMLHint options here
  }
}

Some comments on "vnu" options:

  • The "version" and "verbose" options will always fall back to false. These options are of little use, but cause some problems, so they are disabled. The "verbose" option just prints path to file being checked, anyway this plugin does it by itself.
  • There is no need to set the "format" option for v.Nu, this option will always be "json". Other formats for v.Nu are not supported, as they are useless for console output but require parsing, formatting, and so on. If for some reason you need those formats, define the "logToFile" option with the path to log file, then you can parse that file to any format you need.
  • The "user-agent" option will always be "Validator.nu/LV". Checking HTTPS/HTTP URLs is not supported.
  • To avoid confusion with regular expressions, always use the recommended pattern for "filterpattern" option, like this: '.*someword.*'. If you want to filter multiple messages, just define "filterfile" option and then filter out as many messages as you want.
const gulp = require('gulp');
const conform = require('gulp-html-conformance');

gulp.task('lintHtml', () =>
  gulp
    .src('./src/*.html')
    .pipe(
      conform({
        logToFile: './logs/lintHtml.log',
        vnu: {
          filterpattern: '.*name.*'
        },
        htmlhint: {
          'space-tab-mixed-disabled': 'space'
        }
      })
    )
    .pipe(gulp.dest('./dest'))
);

See also

gulp-html :arrow_backward: source of inspiration gulp-htmlhint