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

yatter

v3.2.1

Published

tool collection

Readme

yatter

yatter 是一个用 TypeScript 编写的现代化工具库,旨在为前端开发提供一套轻量、严谨且高效的工具函数集。

✨ 特性

  • TypeScript 原生支持:完善的类型推导和声明文件。s
  • 现代功能支持:深度相等判断(支持 Map/Set/稀疏数组)、防抖/节流、数组/对象操作等。
  • 轻量无依赖:核心库无任何第三方依赖。

📦 安装

npm install yatter
# 或
yarn add yatter
# 或
pnpm add yatter

🚀 快速使用

深度相等判断 (isEquals)

支持 Map、Set、稀疏数组、Date、RegExp 以及嵌套对象。

import { isEquals } from 'yatter';

const objA = { a: [1, new Set([2])] };
const objB = { a: [1, new Set([2])] };

console.log(isEquals(objA, objB)); // true

强大的排序函数 (sorter)

支持多维度的升降序排列。

import { sorter } from 'yatter';

const list = [
  { age: 28, name: 'Alice' },
  { age: 22, name: 'Bob' },
  { age: 22, name: 'Carol' }
];

// 先按 age 升序,age 相同时按 name 降序
const sorted = list.sort(
  sorter(u => [u.age, u.name], ['asc', 'desc'])
);

数值处理 (clamp & range)

import { clamp, range } from 'yatter';

console.log(clamp(15, 0, 10)); // 10
console.log(range(5));         // [0, 1, 2, 3, 4]
console.log(range(0, 10, 2));  // [0, 2, 4, 6, 8]

防抖与节流 (debounce & throttle)

import { debounce } from 'yatter';

const handleSearch = debounce((query) => {
  console.log('Searching for:', query);
}, 300);

📖 完整 API 文档

有关全部方法、参数详情及更多使用示例,请访问我们的:

👉 yatter API 在线文档


License: ISC
Author: leemotive