# 推荐工具
新工具体系不再维护开源工具方法的代理,直接提供合用开源工具的地址指向。
一些旧的工具函数不再提供,转为推荐相应的开源工具。
# Cookie
- js-cookie (opens new window) 前端 cookie 管理
# Number
- lodash/clamp (opens new window) 限制数字在指定范围内
# Object
- lodash/set (opens new window) 设置对象指定 xpath 上的值
- lodash/get (opens new window) 获取对象指定 xpath 上的值
# String
# Array
- lodash/includes (opens new window) 检查元素是否在集合内
- lodash/remove (opens new window) 移除数组元素,返回新数组
- lodash/pull (opens new window) 移除数组元素,在原数组操作
- lodash/find (opens new window) 查找符合条件的元素
- lodash/findIndex (opens new window) 符合条件的元素所在的位置
- lodash/flatten (opens new window) 数组扁平化
# Location
- url-join (opens new window) URL 字符串连接
- url-parse (opens new window) URL 解析为 Location 对象
- query-string (opens new window) query 解析与构造
# Dom
- document-offset (opens new window) 获取元素位置与尺寸
# Event
- Mitt (opens new window) 观察者模式的实现
# IO
- axios (opens new window) 前后端通用请求库
- node-fetch (opens new window) Node 环境下使用 fetch Api
# Fx
- tween.js (opens new window) 环境无关的动画执行函数
# Polyfill
- IntersectionObserver (opens new window) 滚动监听
- fetch (opens new window) fetch Api
# 其他
- async (opens new window) 实现多种不同模式的异步任务处理方案,比如异步队列就可以用这个工具实现
- collect (opens new window) 处理数组与对象的一批工具函数
- lazy (opens new window) 利用延迟计算实现高性能数据梳理的工具库
- path-to-regexp (opens new window) 地址匹配
- date-fns (opens new window) 日期处理
- fastclick (opens new window) 移动端点击优化
- history (opens new window) 浏览器历史管理
← 参考文档