Registry / devops / uglifyjs-folder

uglifyjs-folder

JSON →
library3.3.0jsnpmunverified

A CLI tool that minifies all JavaScript files in a folder into a single output file using the terser minifier (v5.18.1). It supports configurable glob patterns, per-file minification, comment preservation, and custom output extensions. Current stable version is 3.3.0, released June 2023. Updated regularly to track terser releases. Key differentiator: batch processing of entire folders with flexible output options, unlike single-file minifiers.

npm install uglifyjs-folder
INSTALL
IMPORT
SIG · UGLIFYJS-FOLDER
U
uglifyjs-folder
devopsjavascriptv3.3.0
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.

default
import uglifyjsFolder from 'uglifyjs-folder';
const uglifyjsFolder = require('uglifyjs-folder');
Main use is CLI; programmatic API is synchronous/async but not officially documented. ESM import works if package supports it.
uglifyjs-folder CLI
npx uglifyjs-folder path/to/folder --output bundle.min.js
uglifyjs-folder path --out bundle.js
Option flag is --output or -o, not --out. Also the package must be installed globally or via npx.
–log-level
uglifyjs-folder src --log-level error
uglifyjs-folder src --loglevel error
Double dash and hyphenated: --log-level, not --loglevel.

Shows installing the package globally, creating two JS test files, and minifying the folder into a single bundle file.

npm install -g uglifyjs-folder mkdir -p my-project cat > my-project/main.js << 'EOF' function hello() { return 'world'; } EOF cat > my-project/lib.js << 'EOF' const x = 5; EOF uglifyjs-folder my-project -o bundle.min.js cat bundle.min.js
Debug
Known issues
breakingAPI changed from synchronous to async/await in v3.0.0 (released 21/Jun/2021).
fix
If using programmatic API, update code to use async/await. The CLI interface unchanged.
affects: >=3.0.0
breakingDropped uglify-js and uglify-es in v2.0.0; now uses terser exclusively.
fix
Remove any calls to uglify-js specific options; terser is mostly compatible but check config file keys.
affects: >=2.0.0
deprecatedThe `--harmony` flag is no longer supported (removed when uglify-es was dropped).
fix
Remove --harmony from CLI commands; terser handles ES6+ by default.
affects: >=2.0.0
gotchaWhen using `--each` with `--extension .js` and same output folder, files may overwrite originals.
fix
Use a different output folder or extension (e.g., -x .min.js).
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'uglifyjs-folder'
Package is not installed globally or locally.
fix
Run `npm install -g uglifyjs-folder` to install globally, or `npm install --save-dev uglifyjs-folder` for local and use npx.
Command not found: uglifyjs-folder
Global installation not in PATH or not installed.
fix
Ensure npm global bin directory is in PATH, or use `npx uglifyjs-folder`.
TypeError: Cannot read property 'toUpperCase' of undefined
Missing or incorrect options argument (e.g., -o without value).
fix
Check CLI syntax: `uglifyjs-folder src -o output.min.js`.
Upgrade
Version history
3.3.0latest on npm
Audit
Dependencies
terserrequiredJavaScript minification engine (replaced uglify-js in v2.0.0)
Agent activity
4 hits · last 30 days
node
4
Resources
uglifyjs-folder — npm install uglifyjs-folder · libregistry