查看js的有效使用情况:

https://github.com/gmetais/unusedjs

Installation

You need to open your console and write:

npm install unusedjs -g

Use

  1. Start the server by writing in your console: unused-js-proxy

  2. Configure your browser's proxy to localhost:3838. Only set the HTTP proxy, let the HTTPS (=SSL) proxy empty.

  3. Clear your browser cache <== IMPORTANT

  4. Open your browser's and wait until the page is fully loaded

  5. 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. Android热修复(HotFix)实战

    线上的BUG一直是程序员头疼的问题.有时候仅仅是因为几行的代码,就能让你的用户损失严重.谷歌在Android Studio 加入了Insttan Run 机制.通过Apk动态加载的技术实现了应用非安装 ...

  2. Neuron network

    关于神经网络你不能不知道的一切 作者|Kailash Ahirwar 编译|Sambodhi 编辑|Vincent AI前线导语:理解什么是人工智能,以及机器学习和深度学习是如何影响人工智能的,这是一 ...

  3. Android logcat输出中文乱码

    使用adb的logcat 命令查看系统日志缓冲区的内容,会发现在CMD的界面面,直接输出的中文内容是乱码. 这个问题出现在使用logcat将日志直接打印在当前的DOS窗口的时候会出现:使用logcat ...

  4. SqlServer把日期转换成不同格式的字符串的函数大全

    SQL语句                                        结果SELECT CONVERT(varchar(100), GETDATE(), 0)-- 05 03 20 ...

  5. 迭代器&生成器&yield异步

    迭代器 #迭代器是访问集合元素的一种形式,迭代器从集合的第一个元素开始访问,直到所有的元素被访问# 结束才结束,迭代器只能往前访问,不能往后访问,比如你先访问1,在访问2,在访问3.如果已经# 访问到 ...

  6. 平衡二叉树Balanced Binary Tree

    [抄题]: Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced b ...

  7. OpenStack的架构详解(转)

    OpenStack既是一个社区,也是一个项目和一个开源软件,它提供了一个部署云的操作平台或工具集.其宗旨在于,帮助组织运行为虚拟计算或存储服务的云,为公有云.私有云,也为大云.小云提供可扩展的.灵活的 ...

  8. requestFullscreen()事件全屏不好使怎么解决

    标明:我在360和火狐中全屏requestFullscreen()事件不好使: 解释:我后来发现我的页面是在iframe框架中使用的并且没有设置allowfullscreen="true&q ...

  9. 利用windows.h头文件写一个简单的C语言倒计时

    今天写一个简单的倒计时函数 代码如下: #include<stdio.h> #include<windows.h> int main() { int i; printf(&qu ...

  10. SQA计划和系统测试规程

    SQA计划和系统测试规程 一.SQA计划 1.软件工程 我们小组所做的项目是图书馆管理系统.我们要准确的了解此软件的需求(能够注册登录,查询图书,借书,还书,查看借阅记录等),在此前提进行建模,基于场 ...