unusedjs
查看js的有效使用情况:
https://github.com/gmetais/unusedjs
Installation
You need to open your console and write:
npm install unusedjs -g
Use
Start the server by writing in your console:
unused-js-proxyConfigure your browser's proxy to
localhost:3838. Only set the HTTP proxy, let the HTTPS (=SSL) proxy empty.Clear your browser cache <== IMPORTANT
Open your browser's and wait until the page is fully loaded
Open your browser's console and write
_unusedjs.report()
Results
Results are displayed in the console:

Why "(for the moment)"? Because the score might change if some more JS gets executed in the page.
Inspect what code is unused for one file (experimental)
_unusedjs.file(<file number>)
There are stille some bugs with very large files, especially when minified on one very long line. Best displayed on Chrome or Safari.

unusedjs的更多相关文章
随机推荐
- 1、JDK自带注解
1.何为注解? 概念:注解(Annotation),也叫元数据.一种代码级别的说明.它是JDK1.5及以后版本引入的一个特性,与类.接口.枚举是在同一个层次.它可以声明在包.类.字段.方法.局部变量. ...
- hdoj1260 Tickets (简单DP)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1260 思路: 很简单的DP题,状态方程也比较容易想到,用f[i]表示到第i个人所耗的最短时间,详见代码 ...
- Connections in Galaxy War(逆向并查集)
Connections in Galaxy War http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3563 Time Limit ...
- 【校招面试 之 C/C++】第12题 C++ 重载、重写和重定义
1.成员函数重载特征: a.相同的范围(在同一个类中): b.函数名字相同: c.参数不同(参数个数不同或者参数类型不同,但是返回值不同不能使重载): d.virtual关键字可有可无. 2.重写 ...
- 利用python实现冒泡排序
1.先生存一个随机数组成的list 2.然后进行排序,把大的元素放在后面,小的元素放在前面,最终实现从小到大排列 首先生存一个随机数组成的list import random # print(sys. ...
- jquery 动态添加的代码不能触发绑定事件
今天发现jQuery对动态添加的元素不触发事件,比如blur.click事件等 参考文章证明了我的结论,并给出了原因及解决方案 原因:程序找不到动态添加的节点. 解决方案:在绑定父元素后的子元素 $( ...
- OC - 缓存 - NSCache - 介绍
- 1. Spring boot 之热部署
1. spring boot 热部署 1.1. springloaded springloaded可以实现修改类文件的热部署.下载地址:springloaded 安装单击Run Configurati ...
- 7-qt随机数qrand
QT生成随机数和C语言差距不大,C语言用srand()和rand(),QT是用Qsrand()和qrand(): QT生成随机数的格式是: qsrand(QTime(0,0,0).secsTo(QTi ...
- phpcms如何给已有的模块添加新功能?
phpcms如何给已有的模块添加新功能? 方法一:直接在模块里的控制器文件中添加功能. 不建议使用此方法,因为一旦phpcms升级,有可能会覆盖模块中的文件, 导致你添加的功能丢失. 方法二:新建一个 ...