
Security News
The AI Industry Is Betting on Open Weights
An open letter signed by 50 companies, from NVIDIA and Microsoft to Mistral and Hugging Face, urges Washington not to restrict open weight AI.
js-util-libs
Advanced tools
js 常见函数工具库
npm install js-util-libs --save
1、防抖节流
2、深拷贝
3、浅拷贝
4、call,apply,bind
6、转义字符转换
7、匹配字符串中所有图片src
8、复制文本到粘贴板
9、判断是浏览器内核
10、获取HTML中的纯文本信息
11、去除空格
12、数字千分位分割(10,000,000)
13、将阿拉伯数字翻译成中文的大写数字(五仟二百二十二)
14、数字转为大写金额 (壹仟零伍拾贰万玖仟伍佰贰拾元整)
15、文件大小格式化 (B,KB,MB,GB)
16、动态加载外部样式文件
17、异步加载外部多个js(动态插入)
18、获取地址栏url参数
19、手机号中间四位变成* (177****698)
20、滚动条滚动
1.动画缓冲(scrollAnimation)
2.滚动页面到顶部(scrollToTop)
3.滚动页面到底部(scrollToBottom)
21、时间戳转格式
1:YYYY-MM-DD HH:MM:SS
2:刚刚、几天前、几个月前、几年前
3:星期几
22、随机数
1:指定长度随机字符串
2:范围内随机数
3:数组取随机数
23、6种排序方式
1:冒泡排序
2:计数排序
3:插入排序
4:归并排序
5:快速排序
6:选择排序
24、数组
1.扁平数据结构转Tree
2.去重
3.扁平化(降维)
25、Base64
1.加密
2.解密
26、UTF-8
1.加密
2.解密
27、cookie
1.设置
2.获取
3.移除
28、常用校验
1.邮箱校验
2.手机号校验
3.微信号校验
4.QQ号校验
5.车牌号校验
6.密码强度校验
7.是否包含中文校验
8.邮编号校验
9.16进制颜色校验
10.身份证号校验
11.Ipv4校验
12.手机是Andoird还是IOS
13.是否数字
14.是否对象
15.是否空对象
16.是否数组
17.数据类型判断
18、银行卡号码校验(luhn算法)
19.验证版本号格式必须为X.Y.Z
20.验证护照(包含香港、澳门)
提 Pr 步骤
1、src 底下创建自己模块函数的文件夹
2、函数模块包含 markdow 说明,有自己测试用例(必须)
3、根部 index.js 导出函数
4、packjson keywords 里写自己函数关键字
5、npm test 跑测试用例
6、不要修改 packjson 版本号,版本号为线上最新用户使用版本
7、Pull requests 测试用例过后,静等作者合代码

MIT Copyright (c) 2022 - forever Naufal Rabbani
FAQs
js常见的函数工具库
The npm package js-util-libs receives a total of 2 weekly downloads. As such, js-util-libs popularity was classified as not popular.
We found that js-util-libs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
An open letter signed by 50 companies, from NVIDIA and Microsoft to Mistral and Hugging Face, urges Washington not to restrict open weight AI.

Security News
/Research
A fake corepack.org site is impersonating the Node.js tool and delivers an infostealer and proxyware to developers who download it.

Research
/Security News
A large-scale campaign abused GitHub Actions in compromised repositories to exploit CVE-2026-41940 in cPanel and WHM and steal server credentials.