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

@1-/minify_htm

v0.1.0

Published

Lightweight HTML minifier that fixes script tag closing issues

Readme

English | 中文


@1-/minify_htm : Lightweight HTML minification with script tag fixes

Functionality

Minifies HTML content while preserving essential functionality and fixing script tag closing issues. Addresses the common problem where minification incorrectly transforms </script> into ;</script>, which breaks browser parsing.

Usage demonstration

Install the package:

npm install @1-/minify_htm

Use in JavaScript:

import minify from '@1-/minify_htm';

const html = '<html><body><script>console.log("hello");</script></body></html>';
const minified = minify(html);
console.log(minified);
// Output: <html><body><script>console.log("hello");</script></body></html>

Design rationale

The package wraps the robust @minify-html/node library with targeted configuration and post-processing to ensure compatibility with modern browsers.

Technology stack

  • Core minifier: @minify-html/node
  • Runtime: Modern Node.js (ESM modules)
  • Encoding: TextEncoder/TextDecoder for efficient string conversion

Code structure

src/
├── _.js          # Main entry point exporting minify function

Historical context

HTML minification emerged in the early 2010s as web performance optimization became critical. The first widely adopted tools like HTMLMinifier appeared around 2012, addressing the need to reduce bandwidth usage and improve page load times. Modern minifiers evolved to handle complex edge cases like script tag parsing, which remains challenging due to HTML's forgiving parser specifications.

About

This library is developed by WebC.site.

WebC.site: A new paradigm of web development for AI


@1-/minify_htm : 轻量级 HTML 压缩并修复脚本标签闭合

功能特性

压缩 HTML 内容同时保持核心功能正常,并修正脚本标签闭合问题。解决压缩过程中将 </script> 错误转换为 ;</script> 导致浏览器解析失败的常见问题。

使用示例

安装包:

npm install @1-/minify_htm

JavaScript 中使用:

import minify from '@1-/minify_htm';

const html = '<html><body><script>console.log("hello");</script></body></html>';
const minified = minify(html);
console.log(minified);
// 输出: <html><body><script>console.log("hello");</script></body></html>

设计思路

该包封装了健壮的 @minify-html/node 库,通过针对性配置和后处理确保与现代浏览器兼容。

技术栈

  • 核心压缩器:@minify-html/node
  • 运行时:现代 Node.js(ESM 模块)
  • 编码:TextEncoder/TextDecoder 实现高效字符串转换

代码结构

src/
├── _.js          # 主入口文件,导出 minify 函数

历史背景

HTML 压缩技术在 2010 年代初随网页性能优化需求兴起。首个广泛采用的工具 HTMLMinifier 于 2012 年左右出现,旨在降低带宽消耗并提升页面加载速度。现代压缩器逐步演进以处理脚本标签解析等复杂边缘情况,这始终是挑战性课题,源于 HTML 解析器规范的宽容特性。

关于

本库由 WebC.site 开发。

WebC.site : 面向人工智能的网站开发新范式