UglifyPHP
UglifyPHP is a JavaScript minifier and obfuscator for PHP files.
This should not be used as a licensing solution.
Installation
$ npm install uglify-php
Usage
const UglifyPHP = require('uglify-php');
UglifyPHP.minify("file.php", {
"excludes": [
'$GLOBALS',
'$_SERVER',
'$_GET',
'$_POST',
'$_FILES',
'$_REQUEST',
'$_SESSION',
'$_ENV',
'$_COOKIE',
'$php_errormsg',
'$HTTP_RAW_POST_DATA',
'$http_response_header',
'$argc',
'$argv',
'$this'
],
"minify": {
"replace_variables": true,
"remove_whitespace": true,
"remove_comments": true
},
"output": "file_min.php"
}).then(function (source) {
console.log(source);
});