A simple Node.js script to minify JavaScript files in a specified directory.
To install the utility globally:
npm install -g @frankhoodbs/uglify-js
To use the utility:
fh-uglify-js <path_to_directory>
Replace <path_to_directory>
with the path to the directory containing the JavaScript files you want to minify.
If you have a directory named dist
with JavaScript files, you can minify them with:
fh-uglify-js ./dist
- Easy to use: just provide the path to the directory.
- Provides feedback for each file processed.
- Uses UglifyJS for minification, ensuring high-quality and efficient results.
Files that are successfully minified will be indicated with a ✅ and the path to the file in green. Files that fail to minify will be indicated with a 🚫 and the path to the file in red.
This utility is built on several popular Node.js packages, including UglifyJS, chalk, node-emoji, and walk-sync. Thanks to all the maintainers and contributors of these libraries for making this utility possible!
ISC
If you encounter any issues or have feedback, please contact us.