node-minify

Featured

Compress JavaScript, CSS, HTML, JSON, and image files using node-minify library. Use when: minifying/compressing assets, bundling JS/CSS files, optimizing images (WebP/AVIF), concatenating files, or when user mentions "node-minify", "@node-minify", "minification". Triggers: "minify", "compress JS/CSS", "bundle", "optimize images", "reduce file size".

Web & Frontend 519 stars 50 forks Updated 3 days ago MIT

Install

View on GitHub

Quality Score: 91/100

Stars 20%
90
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# node-minify Lightweight Node.js minification library supporting JS, CSS, HTML, JSON, and images. ## Installation ```bash # Core + compressor(s) npm install @node-minify/core @node-minify/terser ``` ## Quick Start ```ts import { minify } from "@node-minify/core"; import { terser } from "@node-minify/terser"; // File-based await minify({ compressor: terser, input: "src/app.js", output: "dist/app.min.js", }); // In-memory const result = await minify({ compressor: terser, content: "const x = 1; const y = 2;", }); ``` ## Compressor Selection | Type | Recommended | Alternatives | |------|-------------|--------------| | **JS** | `terser` (modern, fast) | `esbuild` (fastest), `swc`, `oxc`, `uglify-js`, `google-closure-compiler` (advanced optimizations, requires Java) | | **CSS** | `lightningcss` (Rust, fastest) | `esbuild`, `clean-css`, `cssnano`, `csso` | | **HTML** | `html-minifier` | `minify-html` | | **JSON** | `jsonminify` | - | | **Images** | `sharp` (WebP/AVIF) | `svgo` (SVG), `imagemin` (PNG/JPEG/GIF) | | **Utility** | `no-compress` | Pass-through for concatenation without minification | **Deprecated (avoid)**: `babel-minify`, `uglify-es`, `yui`, `crass`, `sqwish` ## API Reference ### Settings (user input) ```ts type Settings = { compressor: Compressor; // Required: compressor function input?: string | string[]; // File path(s) or glob: "src/*.js" output?: string | string[]; // Output path(s) or pattern: "$1.min.js" cont...

Details

Author
srod
Repository
srod/node-minify
Created
14 years ago
Last Updated
3 days ago
Language
TypeScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category