---
url: https://sugarat.top/weekly/2024-09-28.md
description: >-
  ① 你不知道的 AbortController ② AI 驱动的JS反混淆工具 ③ 开源许可证选择 ④ UptimeFlare - 网站在线状态监控 ⑤
  MingCute Icon - 开源图标库 ⑥ JS 各个压缩库对比 ⑦ 即将到来的 Deno 2.0  ⑧ Compress JPG - 图片压缩工具
---

# 视野修炼第103期 | 优雅的移除事件

欢迎来到第 103 期的【视野修炼 - 技术周刊】，下面是本期的精选内容简介

\[\[toc]]

下面开始本期内容的介绍**ღ( ´･ᴗ･\` )比心**。

## 🔥强烈推荐

### [1. 你不知道的 AbortController](https://mp.weixin.qq.com/s/m9jV0gENV1GDiv1MHC5sWQ)

① 终止`fetch`请求

```js
const controller = new AbortController()

const response = fetch('/api', {
  signal: controller.signal,
})

controller.abort() // 终止请求
```

② 取消事件监听

```js
const controller = new AbortController()
window.addEventListener('resize', handleResize, {
  signal: controller.signal,
})
window.addEventListener('hashchange', handleHashChange, {
  signal: controller.signal,
})
window.addEventListener('storage', handleStorageChange, {
  signal: controller.signal,
})

controller.abort() // 一次性取消相关事件监听
```

③ 请求超时控制

```js
fetch('/api', {
  signal: AbortSignal.timeout(1000),
})
```

![](https://cdn.upyun.sugarat.top/mdImg/sugar/2fdb0546c4dd1fc0537c5a0e47e00678)

兼容性还是很不错！*又学到一手日常能用的。*

### [2. AI 驱动的JS反混淆工具](https://github.com/jehna/humanify)

目前支持 openai ，gemini，本地模型三种。

![](https://cdn.upyun.sugarat.top/mdImg/sugar/a2c9a9484712f819995dc08b4fd71fd1)

*代码量少的可以试试，但常规的构建工具处理后的混淆js还是几十到几百 KB 不等，在线大模型还是费钱。*

## 🔧开源工具&技术资讯

### [3. 开源许可证选择](https://open-source-license-chooser.toolsnav.top/zh/)

通过几个简单的小问题，为你推荐合适的许可证！

![](https://cdn.upyun.sugarat.top/mdImg/sugar/00fd0113093a32135b2ab890b3dfc115)

### [4. UptimeFlare](https://github.com/lyc8503/UptimeFlare/tree/main) - 网站在线状态监控

> 一个由 Cloudflare Workers 驱动的功能丰富、Serverless 且免费的 Uptime 监控及状态页面。

![](https://cdn.upyun.sugarat.top/mdImg/sugar/3eadcf745104bc468fc7d9f04a88dc16)

### [5. MingCute Icon](https://www.mingcute.com/) - 开源图标库

![](https://cdn.upyun.sugarat.top/mdImg/sugar/e7dce37e48eb6bca4a241d6736b4c934)

*直接收藏，总能用上。*

### [6. JS 各个压缩库对比](https://github.com/privatenumber/minification-benchmarks)

该仓库用于 JavaScript minifier 基准测试，测量了压缩的平均时间以及产物大小等关键的性能指标。

![](https://cdn.upyun.sugarat.top/mdImg/sugar/49c3e69eefecd49b41e8eb03482c5ce4)

*这个去年也推过一次，和去年的相比现在数据仅有很微小的变化。*

### [7. 即将到来的 Deno 2.0](https://mp.weixin.qq.com/s/Exzty07ahfL9W5WryhmI1A)

> Deno 是一个简单、先进且安全的 JavaScript 和 TypeScript 运行时环境，其基于 V8 引擎并采用 Rust 编程语言构建。

![](https://cdn.upyun.sugarat.top/mdImg/sugar/14d1dd39e8d820bb590ac5939d7f1899)

*有一些 break change，可以了解一下，国内企业使用的应该还比较少，日常可以拿来做 TS 执行工具。*

### [8. Compress JPG](https://compressjpg.io/zh-CN) - 图片压缩工具

![](https://cdn.upyun.sugarat.top/mdImg/sugar/c505f267c192c47e8288d5287a45f4c9)

## ⭐️强力推荐关注

> 周刊部分内容来源如下渠道，推荐大家关注。

* [阮一峰: 科技爱好者周刊](https://www.ruanyifeng.com/blog/archives.html) - 记录每周值得分享的科技内容，周五发布
* [云谦：MDH 前端周刊](https://sorrycc.com/mdh/) - 前端资讯和分享
* [童欧巴：前端食堂](https://github.com/Geekhyt/weekly) - 你的前端食堂，吃好每一顿饭
* [前端 RSS](https://fed.chanceyu.com/) - 根据 RSS 订阅源抓取最新前端技术文章
* [值得一读技术博客](https://daily-blog.chlinlearn.top/) - 每天进步一点点，每天分享有料的技术文章！
* [FRE123 技术周刊精选](https://www.fre321.com/weekly) - 技术周刊精选推荐信息流
