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

hexo-lightning-minify

v0.1.5

Published

A Hexo plugin that can automatically minify JS, CSS, and HTML files at lightning speed.

Downloads

536

Readme

hexo-lightning-minify

WIP 中文版本

Introduction

This plugin is a minifier module split from hexo-renderer-multi-next-markdown-it. Based on more modern minifiers (such as lightningcss and minify-html), it significantly improves speed compared to the older version.

If you need more comprehensive optimization, you can try hexo-optimize. This project is more inclined to exist as a supporting package for ShokaX, thus it only provides basic minification and optimization functions.

Installation

pnpm add hexo-lightning-minify # Recommended to use pnpm
npm install hexo-lightning-minify

Configuration

minify:
  js:
    enable: true # ShokaX comes with esbuild optimization, not recommended to enable. Recommended for other themes.
    exclude: # Exclude files, accept string[], must match micromatch format
  css:
    enable: true # Enable CSS optimization
    options:
      targets: ">= 0.5%" # browserslist format target
    exclude: # Exclude files, accept string[], must match micromatch format
  html:
    minifier: html-minifier # minify-html(faster) or html-minifier(more stable)
    enable: true # Enable HTML optimization
    options:
      comments: false # Whether to preserve comment content
    exclude: # Exclude files, accept string[], must match micromatch format
  image:
    enable: true # Enable image preprocessing and automatic WebP conversion(hexo d)
    options:
      avif: false
      webp: true # Reserved configuration item, no effect in the current version
      quality: 80 # Quality, supports integers from 1-100, lossless, or nearLossless
      effort: 2 # CPU effort, an integer between 0 and 6 (lower for faster)
      replaceSrc: true # Automatically replace local image links in generated HTML with WebP links
      # We recommend using a Service Worker to implement the replaceSrc functionality on the user side, which will enable link replacement in a less intrusive manner.
    exclude:

Features

  • [x] Automatically minify js, css, and html
  • [x] Automatically handle CSS prefix compatibility based on targets
  • [x] Automatic webp conversion and image preprocessing
  • [ ] Automatic pre-connection optimization (long term)

Comparison

On ShokaX v0.3.9:
When run hexo ghexo-lightning-minify runs ~1.88x faster than HRMNMI(HRMMIR),~1.3x faster than hexo-neat

based on hexo-many-posts test:

with Hexo 6.3.0, only test the compression of html, css and js.

| | base | hexo-neat | hexo-minify | hexo-all-minifier | hexo-lightning-minify | | :--------------------------- | ------- | --------- | ----------- | ----------------- | --------------------- | | landscape | 10.529s | 37.918s | 36.844s | 38.572s | 16.304s | | next | 27.275s | 36.124s | 42.854s | 37.063s | 29.880s | | butterfly | 13.853s | 26.641s | 26.736s | 35.973s | 16.796s | | particlex | 24.422s | 200.641s | 193.981s | 201.601s | 40.478s | | reimu | 17.631s | 52.432s | 48.524s | 51.835s | 23.938s | | shokax(hexo-renderer-marked) | 13.189s | 20.618s | 19.658s | 22.448s | 14.619s |

chart1

| | base | hexo-neat | hexo-minify | hexo-all-minifier | hexo-lightning-minify | | :--------------------------- | ------------ | ------------ | ------------ | ----------------- | --------------------- | | landscape | 99,617,529B | 97,186,156B | 92,010,232B | 97,184,707B | 88,175,339B | | next | 32,469,157B | 30,087,003B | 28,744,583B | 30,059,443B | 28,020,740B | | butterfly | 37,593,633B | 37,237,074B | 33,485,597B | 34,897,171B | 35,504,670B | | particlex | 540,876,348B | 226,997,833B | 214,050,994B | 226,990,791B | 221,896,130B | | reimu | 110,252,086B | 95,756,049B | 91,074,639B | 95,715,486B | 88,088,009B | | shokax(hexo-renderer-marked) | 142,585,026B | 142,404,138B | 140,988,094B | 142,011,849B | 140,457,331B |

The hexo-theme-particlex has been removed from the chart for a clearer comparison.

chart2