tedivm/jshrink
Composer 安装命令:
composer require tedivm/jshrink
包简介
Javascript Minifier built in PHP
关键字:
README 文档
README
JShrink is a php class that minifies javascript so that it can be delivered to the client quicker. This code can be used by any product looking to minify their javascript on the fly (although caching the results is suggested for performance reasons). Unlike many other products this is not a port into php but a native application, resulting in better performance.
Usage
Minifying your code is simple call to a static function-
<?php include('vendor/autoload.php'); // Basic (default) usage. $minifiedCode = \JShrink\Minifier::minify($js); // Disable YUI style comment preservation. $minifiedCode = \JShrink\Minifier::minify($js, array('flaggedComments' => false));
Results
- Raw - 586,990
- Gzip - 151,301
- JShrink - 371,982
- JShrink and Gzip - 93,507
Installing
Composer
Installing JShrink can be done through a variety of methods, although Composer is recommended.
"require": { "tedivm/jshrink": "~1.0" }
Github
Releases of JShrink are available on Github.
License
JShrink is licensed under the BSD License. See the LICENSE file for details.
In the spirit of open source, use of this library for evil is discouraged but not prohibited.
Reporting Security and Vulnerability Issues
This project utilizes the Tidelift Security Reporting System for security and vulnerability reporting.
Support
Issues can be opened directly in Github for issues that aren't related to security.
Professionally supported JShrink is now available with Tidelift.
tedivm/jshrink 适用场景与选型建议
tedivm/jshrink 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 39.55M 次下载、GitHub Stars 达 760, 最近一次更新时间为 2012 年 03 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「javascript」 「minifier」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 tedivm/jshrink 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tedivm/jshrink 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 tedivm/jshrink 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Generates a Blade directive exporting all of your named Laravel routes. Also provides a nice route() helper function in JavaScript.
HTMLMin Is A Simple HTML Minifier For Laravel
Caching and compression for Twig assets (JavaScript and CSS).
A pretty nice way to expose your translation messages to your JavaScript.
A token based Javascript parser/minifier designed for compressing inline scripts on the fly, written in PHP
A token based CSS Document parser and minifier written in PHP
统计信息
- 总下载量: 39.55M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 773
- 点击次数: 21
- 依赖项目数: 148
- 推荐数: 12
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2012-03-11