UglifyPHP is a JavaScript minifier and simple obfuscator for PHP files. It uses a unique ID based on current time to replace variable names, allowing multiple minified files to coexist without variable overwriting. It correctly handles class methods and $this references, but does not modify function names or inject junk code for performance reasons. The package is NOT a security solution and should not be used for licensing or code protection. Current stable version is 1.0.7. It is a lightweight tool for basic PHP code minification and obfuscation, with options to exclude specific variables, remove whitespace, and remove comments. It runs in Node.js and outputs either a minified file or source code as a promise.
npm install uglify-phpNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows CommonJS require usage, option configuration, and promise-based minification with error handling.
Do not rely on this for licensing or security; use a dedicated code protection tool if needed.
Always use .then() or async/await to handle the result.
If collision is a concern, add a small delay or custom prefix.
Consider alternatives like 'php-minify' or 'PHP Minify' if you need active support.
Use const UglifyPHP = require('uglify-php');Ensure the path is correct, or pass the source code as a string instead.
Use .then()/catch() or upgrade Node.js to version 7.6+.
No dependency data recorded yet.