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

gulp-hmin

v0.0.4

Published

Gulp plugin for minify html files

Readme

gulp-hmin

npm version License: MIT TypeScript

Gulp plugin for minifying HTML files using html-minifier-next.

Description

gulp-hmin is a lightweight Gulp plugin that minifies HTML files with the powerful html-minifier-next library. It supports all standard minification options: collapsing whitespace, removing comments, minifying inline CSS and JavaScript, and many more.

Installation

npm install --save-dev gulp-hmin

Or using yarn:

yarn add -D gulp-hmin

Or using pnpm:

pnpm add -D gulp-hmin

Usage

ES Modules (recommended)

import { src, dest } from "gulp";
import htmlmin from "gulp-hmin";

function minifyHTML() {
  return src("src/**/*.html")
    .pipe(
      htmlmin({
        collapseWhitespace: true,
        removeComments: true,
        minifyJS: true,
        minifyCSS: true,
        // ... other options
      }),
    )
    .pipe(dest("dist"));
}

export default minifyHTML;

CommonJS

const { src, dest } = require("gulp");
const htmlmin = require("gulp-hmin");

function minifyHTML() {
  return src("src/**/*.html")
    .pipe(
      htmlmin({
        collapseWhitespace: true,
        removeComments: true,
        minifyJS: true,
        minifyCSS: true,
      }),
    )
    .pipe(dest("dist"));
}

exports.minify = minifyHTML;

Complete Gulpfile example

import { deleteAsync } from "del";
import { series, src, dest } from "gulp";
import htmlmin from "gulp-hmin";

// Clean output directory
async function clean() {
  await deleteAsync(["dist/*"]);
}

// Copy static assets (CSS, JS, images)
function copy() {
  return src(["src/{css,js,images}/**/*"], { base: "src" }).pipe(dest("dist"));
}

// Minify HTML
function minify() {
  return src("src/*.html")
    .pipe(
      htmlmin({
        collapseWhitespace: true,
        removeComments: true,
        minifyJS: true,
        minifyCSS: true,
      }),
    )
    .pipe(dest("dist"));
}

// Export tasks
export { clean, copy, minify };
export const build = series(clean, copy, minify);

API

htmlmin(options)

  • options (Object) – configuration passed directly to html-minifier-next. All options are optional.

Common options:

| Option | Type | Default | Description | | --------------------------- | ------- | ------- | ----------------------------------- | | collapseWhitespace | boolean | false | Collapse whitespace between tags | | removeComments | boolean | false | Remove HTML comments | | minifyJS | boolean | false | Minify inline JavaScript | | minifyCSS | boolean | false | Minify inline CSS | | removeEmptyAttributes | boolean | false | Remove attributes with empty values | | removeRedundantAttributes | boolean | false | Remove redundant attributes | | useShortDoctype | boolean | false | Use short doctype |

Refer to the html-minifier-next documentation for the full list of available options.

Development

The project uses TypeScript, Vitest for testing, and oxlint/oxfmt for linting and formatting.

Scripts

  • npm test – run tests with Vitest
  • npm run lint – lint source code with oxlint
  • npm run fix – auto‑fix lint issues
  • npm run check – check formatting with oxfmt
  • npm run fmt – format code with oxfmt
  • npm run typecheck – run TypeScript type checking
  • npm run validate – run lint and typecheck together
  • npm run build – compile TypeScript to CommonJS and ES modules

License

MIT License. © 2025–2026 llcawc. Made with to beautiful architecture.