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

@chzky/std

v2.0.0

Published

[![JSR](https://jsr.io/badges/@chzky/std)](https://jsr.io/@chzky/std)

Downloads

153

Readme

@chzky/std

JSR

标准库,提供常用工具函数、数据结构和算法实现。

模块

集合操作

  • collect - 集合辅助函数(合并、提取、去重、打乱等)

异步工具

  • async - 异步工具(防抖、节流、重试、并发池等)

算法

  • algorithm - 算法实现(布隆过滤器、数组比较、采样、虚拟洗牌)

数学

  • math - 数学函数

数据结构

  • dataStructures - 数据结构

其他

  • crypto - 密码学工具
  • data - 数据处理
  • encode - 编码转换
  • extend - 扩展类型
  • format - 格式化工具
  • generator - 生成器集合
  • middleware - 中间件
  • rules - 校验规则
  • time - 时间相关

安装

# Deno
deno add jsr:@chzky/std

# npm / pnpm / yarn
npm install @chzky/std
pnpm add @chzky/std
yarn add @chzky/std

快速开始

集合操作 (collect)

import { merge, pick, unique, shuffle } from "@chzky/std";

const merged = merge({ a: 1 }, { b: 2 });
// { a: 1, b: 2 }

const picked = pick({ a: 1, b: 2, c: 3 }, ["a", "c"]);
// { a: 1, c: 3 }

const deduped = unique([1, 2, 2, 3, 3, 3]);
// [1, 2, 3]

异步工具 (async)

import { debounce, retry, throttle, sleep } from "@chzky/std";

const debouncedFn = debounce((x: number) => console.log(x), 300);
debouncedFn(1);
debouncedFn(2);

const result = await retry(async () => {
  return await fetchData();
}, { times: 3, delay: 1000 });

await sleep(1000);

数学函数 (math)

import { percent, random, within } from "@chzky/std";

const p = percent(25, 100);
// 25

const n = random(1, 100);
// 42

const ok = within(50, 0, 100);
// true

算法 (algorithm)

import { bloomFilter, diff, virtualShuffle } from "@chzky/std";

const filter = new BloomFilter<string>(1000, 0.01);
filter.add("hello");
filter.has("hello");
// true

const changes = diff([1, 2, 3], [1, 3, 4]);
// { added: [4], removed: [2], kept: [1] }

校验规则 (rules)

import { isEmail, isPhone, isUrl } from "@chzky/std";

isEmail("[email protected]");
// true

isPhone("13800138000");
// true

isUrl("https://example.com");
// true

格式化 (format)

import { formatBytes, formatDuration } from "@chzky/std";

formatBytes(1024 * 1024);
// "1 MB"

formatDuration(3661000);
// "1h 1m 1s"

版本

@chzky/core 保持版本一致。

许可证

MIT