
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
ryy 工具库,提供常用的JavaScript/TypeScript工具函数,包括防抖节流、深拷贝、时间处理、正则表达式验证、URL处理等实用功能,助力前端开发效率提升。
# npm 安装
npm install ryy-utils
# yarn 安装
yarn add ryy-utils
# pnpm 安装
pnpm add ryy-utils
debounce - 函数防抖,限制高频触发事件的执行频率throttle - 函数节流,间隔指定时间执行一次函数deepCopy - 深度拷贝对象/数组数据formatDateTime - 格式化时间为指定格式idCardNoReg - 身份证号验证正则mobileReg - 手机号验证正则moneyReg - 金额验证正则(最多两位小数)urlReg - URL地址验证正则emailReg - 邮箱验证正则file - 文件处理相关工具href - URL处理相关工具http - HTTP请求相关工具import { debounce } from 'ryy-utils';
// 创建防抖处理的搜索函数
const debouncedSearch = debounce((query) => {
console.log('搜索:', query);
// 执行搜索逻辑
}, 500);
// 在输入事件中使用
inputElement.addEventListener('input', (e) => {
debouncedSearch(e.target.value);
});
import { formatDateTime } from 'ryy-utils';
// 格式化当前时间
const now = new Date();
const formattedDate = formatDateTime(now, 'yyyy-MM-dd hh:mm:ss');
console.log(formattedDate); // 例如: 2023-10-15 14:30:25
// 格式化时间戳
const timestamp = 1634253600000;
const dateStr = formatDateTime(timestamp, 'yyyy/MM/dd');
console.log(dateStr); // 例如: 2021/10/15
import { mobileReg, emailReg } from 'ryy-utils';
// 验证手机号
const isValidMobile = mobileReg.test('13812345678');
console.log(isValidMobile); // true
// 验证邮箱
const isValidEmail = emailReg.test('test@example.com');
console.log(isValidEmail); // true
本项目采用 ISC 许可证 - 查看 LICENSE 文件了解详情
FAQs
ryy utils package
We found that ryy-utils demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.