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 🙏

© 2026 – Pkg Stats / Ryan Hefner

jakotsu

v1.0.9

Published

lockingreal util

Readme

写在前面

  • jakotsu/蛇骨,日本漫画《犬夜叉》及其衍生作品中的男性角色。七人帮之一,由折笠爱配音。最早开始追随蛮骨的人。

  • 个人很喜欢jakotsu战斗时气势如虹的飘逸感,这个库本身也是从自身工作角度出手,不像其他库一样细读把握的很细,而是从一块一块的小整功能入手,权当个人的工具类。

  • 有感兴趣的同学可以一起学习,对我而言也算是复习了吧。

只做一般正经库不做的,(●ˇ∀ˇ●)

api列表

is

| function name | function desc | function param | | --------- | ---------- | --------- | | isString | 是否是字符串 | (变量) | | isNumber | 是否是数字 | (变量) | | isFunction | 是否是方法 | (变量) | | isObject | 是否是对象 | (变量) | | isWindow | 是否是Window对象 | (变量) | | isElement | 是否是节点 | (变量) | | isUrl | 是否是url | (变量) | | isPromise | 是否是Promise | (变量) | | isWordFile | 是否是word文件 | (变量) | | isExcelFile | 是否是excel文件 | (变量) | | isPptFile | 是否是ppt文件 | (变量) | | isFullScreen | 当前是否处于F11全屏状态 | (无参数) | | isDarkMode | 检查用户的设备是否处于暗模式 | (无参数) | | isLeapYear | 是否是闰年 | (字符串年份) |

Array

| function name | function desc | function param | | --------- | ---------- | --------- | | getArrayValueByParam | 获取对象数组的指定字段的值集合 | (数组,标识对象属性,属性的限制集合) | | getArrayItemWithParamLimit | 获取对象数组的指定字段的对象集合 | (数组,标识对象属性,属性的限制集合) | | transferArray | 根据需求将数组转移,清空老数组,返回自定义方法下的新数组 | (数组,自定义筛选方法) | | simpleDeDupArray | 简单类型说组去重 | (数组) | | getArrDifference | 获取基本类型数组里不一样的内容组成数组 | (数组1,数组2) | | getArrEqual | 获取基本类型数组里一样的内容组成数组 | (数组1,数组2) | | getArrayCoin | 获取对象数组的指定字段相同的交集数组 | (数组1,数组2,指定字段名) | | getArrayDiff | 获取对象数组的指定字段相同的补集数组 | (数组1,数组2,指定字段名) | | listToTree | 将数组转成树形结构 | (数组,节点的标识字段[ 默认 id ],节点对应的父节点标识字段[ 默认 parentid]) |

Time

| function name | function desc | function param | | --------- | ---------- | --------- | | formatDate | 时间戳转年月日时分秒格式 | (时间戳) | | getSeasonInfoByTimeStamp | 获取指定10位,13位时间戳 对应的 季度信息 | (时间戳) | | getThisWeekStartAndEnd | 获取当前一周的周一和周日 | 无传参 | | getCommonTimeInChinese | YYYY-MM-dd hh:mm:ss 转年-月-日 | (YYYY-MM-dd hh:mm:ss) |

Function

| function name | function desc | function param | | --------- | ---------- | --------- | | treeFind | 树结构按自定义函数规则查询子节点 | (树形数据,自定义方法) | | compose | 经典compose | | | curry | 经典函数柯里化 | | | debounce | 经典防抖 | | | deepClone | 经典深拷贝 | |

others

| function name | function desc | function param | | --------- | ---------- | --------- | | fireKeyEvent | 触发指定键码的键盘时间 | (节点dom对象,'keydown',按键键码) | | toChinesNum | 将数字转成汉字中文 | (数字对象) | | getDeviceInfo | 获取当前浏览器与硬件信息 | (无传参) | | getCookieByName | 通过指定名称获取cookie | (cookie的名称字符串) | | rgbToHex | 颜色RGB转十六进制 | (r,g,b) | | isDateValid | 检查日期是否合法 | (对象值) | | capitalize | 英文字符串首字母大写 | (英文字符串) | | getSvgDomXml | 获取svg dom 节点的xml体 | (Svg dom 节点) | | getSvgDomXmlBase64 | 获取svg dom 节点的xml体 转BASE64 | (Svg dom 节点 Base64) |

License

MIT @lockingreal