npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cowave-utils

v2.7.3

Published

cowave工具包

Downloads

1,300

Readme

cowave-utils 控维工具包

更新记录

2.5.0

  1. 添加组件工具函数 on ,用于中间件透传事件

2.4.0

  1. 加入Vue工具函数,使用cowave-utils/vue 使用 vue工具函数

2.3.0

  1. 包优化

2.2.0

  1. 引入http

2.0.0

  1. 从tsup升级为rollup,并保留注释,新增了所有函数注释使用方法,可以便捷使用所有函数。
  2. 删除getDate的默认formatter, 默认输出Date格式。
  3. 优化setTime时间同步逻辑。

JS工具函数

  1. 全屏

    | 函数 | 功能 | | --------------------------------------------- | -------- | | isFullscreen() | 是否全屏 | | inFullscreen( el : HTMLElement ) | 进入全屏 | | exitFullscreen() | 退出全屏 | | fullscreen( el : HTMLElement ) | 切换全屏 |

  2. 系统

    | 函数 | 返回值 | 功能 | | ---------------------------- | ------------------------------------------- | -------------- | | browserEngine() | "Gecko" | "Blink" | "WebKit" | "Unknown" | 浏览器引擎判断 |

  3. 数字处理

    | 函数 | 功能 | | -------------------------------------------------------- | ---------- | | Num(num: string | number, factor?: number) | 转换为数字 |

  4. 字符串处理

    | 函数 | 功能 | | --------------------------------------------------------------------------------- | ------------------------------ | | toHump(strings: string | string[], hyphenType = '-', isGreatHump? ) | 将连字符字符串转换为驼峰字符串 | | toHyphen(strings: string | string[], hyphenType = '-') | 将驼峰字符串转换为连字符字符串 |

  5. 对象处理

    | 函数 | 功能 | | ------------------------------------------------------------------- | -------------------------------------------- | | getObject(objectArr, keyName, keyValue, foundKeyName?) | 从对象列表中,根据指定键值,找到对象(或属性) | | assignObject(dist: T, src: T): T | 深合并对象 | | expose(option,...refs) | 处理中间件事件向上透传(用于Vue组件封装) |

  6. 时间处理

    | 函数 | 功能 | | --------------------------------------------------------------- | ---------------------------------- | | setTime(callback: () => Date | string | number) | 服务器时间同步 | | getTime() | 获取服务器时间戳 | | getDate(date?: Date | string, formatter?: string) | 获取时间(服务器时间)/转换时间格式 | | getDateObject(date: Date | string | number) | 获取时间对象 | | getSpecialDate(dateType, date?, formatter?) | 获取特殊时间节点(一个月前、一年前) |

  7. AJAX请求

    | 函数 | 功能 | | ------------------------- | ------------- | | createHttp() | 创建axios实例 | | download() | 文件下载 |

  8. 颜色处理 | 函数 | 功能 | 文档 | | --------------------------------- | ---------- | -------------------------------- | | new TinyColor(color) | 颜色处理库 | 地址 |

Vue工具函数

  1. API
  2. 文件处理
  3. store
  4. 发布订阅

Node工具函数

  1. 文件处理

    | 函数 | 功能 | | --------------------------------------------------------- | ------------------------------ | | createDir(path: string) | 创建文件夹 | | readDir(path: string) | 读取文件夹下的所有文件、文件夹 | | readFile(pathName: string) | 读取文件内容 | | writeFile(pathName: string, content: string) | 写入文件内容 | | copyFileOrDir(src: string, dest: string) | 复制文件夹或者文件 | | removeFileOrDir(path: string) | 删除文件夹或者文件 |

  2. 路径处理

    | 函数 | 功能 | | ----------------------------------------------------------------------------- | ------------------------------------------ | | relation(fromPath: string, toPath: string, toPathIsFile = false) | 判断从toPath引入fromPath的路径相对关系 | | filter(files, basePath?, includePath?, excludePath?) | 过滤文件(仅过滤文件路径,不过滤文件夹路径) | | findFiles(srcs, includePath?, excludePath?) | 遍历寻找src目录下的所有文件 |