garfix/js-minify
最新稳定版本:1.0.0
Composer 安装命令:
composer require garfix/js-minify
包简介
A fast Javascript minifier that removes unnecessary whitespace and comments
README 文档
README
A fast Javascript minifier that removes unnecessary whitespace and comments
Installation
If you are using Composer, use
composer require garfix/js-minify
Use
The simplest use of the library comes down to this:
$minifiedJs = \Garfix\JsMinify\Minifier::minify($js);
Where $js contains the unprocessed code and $minifiedJs holds the minified version.
If you want to change the default options, use minify($js, $options), where $options is an array of one or more of the following:
\Garfix\JsMinify\Minifier::FLAGGED_COMMENTS(bool, default:true) When set tofalse,/*! ... */flagged comments are removed as well.
Background
I started this library because I believed JShrink could be made much faster by the use of dedicated regular expressions. This turned out to be true. It is about 10x faster on PHP 7 and 5x faster on PHP 8.
统计信息
- 总下载量: 4.6k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-10-11