Registry / devops / simply-minify

simply-minify

JSON →
library1.0.5jsnpmunverified

A lightweight Node.js minifier for CSS and JS files with a simple API and CLI mode. Version 1.0.5 is the latest stable release. It recursively finds all CSS and JS files in a given directory and minifies them using clean-css (v4.2.1) and UglifyJS3 (v3.6.8). Differentiators: minimal configuration, zero-fuss operation (just call a function), and support for custom options for both minifiers. Primarily for quick build scripts or small projects.

npm install simply-minify
INSTALL
IMPORT
SIG · SIMPLY-MINIFY
S
simply-minify
devopsjavascriptv1.0.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

simplyMinify
const simplyMinify = require('simply-minify')
import simplyMinify from 'simply-minify'
Package is CommonJS-only, no ESM exports. Use require().
function call
simplyMinify('src', {}, {})
simplyMinify({dir:'src'})
Arguments are positional: (dir, CleanCSS_Options, UglifyJS_Options). Passing an object will be misinterpreted.
CLI usage
simplyMinify ./dist
simply-minify ./dist
CLI command is 'simplyMinify' (camelCase), not 'simply-minify'.

Shows basic usage: require, call with no arguments (defaults to ./dist), and with custom directory and minifier options.

const simplyMinify = require('simply-minify'); // Minify all CSS/JS files in the default 'dist' directory simplyMinify(); // With custom directory and options simplyMinify('public/assets', { level: 2 }, { mangle: true });
Debug
Known issues
gotchaArguments are positional, not an options object.
fix
Call simplyMinify(dir, cssOptions, jsOptions) in order.
affects: >=1.0.0
gotchaCLI command is 'simplyMinify', not 'simply-minify'.
fix
Use 'simplyMinify <path>' in terminal.
affects: >=1.0.0
gotchaPackage is CommonJS only. Attempting ESM import will fail.
fix
Use require() instead of import.
affects: >=1.0.0
gotchaAll CSS and JS files in the directory are minified recursively. No exclusion or filtering.
fix
Ensure only intended files are in the target directory or use a subdirectory.
affects: >=1.0.0
deprecatedDependencies clean-css v4.2.1 and uglify-js v3.6.8 are outdated. Possible security vulnerabilities.
fix
Consider using an alternative minifier or updating the package if newer versions are released.
affects: 1.0.5
Errors
Common errors & fixes
TypeError: simplyMinify is not a function
Using ES6 import style on CommonJS package.
fix
const simplyMinify = require('simply-minify');
simply-minify: command not found
CLI command name misspelled or not globally installed.
fix
Install globally: npm install -g simply-minify and use 'simplyMinify' (camelCase).
ENOENT: no such file or directory, scandir 'dist'
Default 'dist' directory does not exist.
fix
Create the folder or pass a valid directory as the first argument.
Error: Invalid options for clean-css
Passing incorrect option keys to CleanCSS_Options object.
fix
Refer to clean-css documentation for valid options, e.g., { level: { 1: { specialComments: 'none' } } }.
Upgrade
Version history
1.0.5latest on npm
Audit
Dependencies
clean-cssrequiredCore dependency for CSS minification
uglify-jsrequiredCore dependency for JS minification (UglifyJS3)
Agent activity
5 hits · last 30 days
node
4
Resources
simply-minify — npm install simply-minify · libregistry