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

@zhangchao9527/zz

v2.1.3

Published

Smart directory history manager - frecency-sorted, with pinned and alias support

Readme

ZZ - 智能目录历史管理工具

English

快速记录和跳转到常用目录的命令行工具。

功能

  • 记录目录: 自动记录访问的目录
  • 快速跳转: 使用索引快速跳转到历史目录
  • 智能排序: 按使用频率和时间排序

与同类工具对比

| 工具 | 实现 | 算法 | 依赖 | 特点 | |---|---|---|---|---| | z | Shell | frecency | 纯 shell | 老牌、轻量 | | autojump | Python | frecency | Python | 跨平台 | | zoxide | Rust | frecency | 单二进制 | 速度极快 | | fasd | Shell | frecency | 纯 shell | 支持文件 | | z.lua | Lua | frecency | lua | 速度快 | | zz(本项目) | Node.js | frecency | Node 18+ | 零额外依赖、SQLite 持久化 |

v2.1.0 新增功能

  • Frecency 排序 — 频率 × 时间衰减(7 天半衰期),新目录自动浮出
  • 分组视图zz ls 展示 收藏 / 常用 / 最近 7 天 / 全部 四组
  • 收藏与别名zz pin / zz unpin / zz alias / zz unalias
  • 清理三件套 — 被动检查 + 启动 GC(1 小时节流)+ 手动 zz rm/zz purge

安装

# 全局安装
npm install -g @zhangchao9527/zz

# 配置 Shell(Zsh)
echo 'source $(npm root -g)/@zhangchao9527/zz/zz.sh' >> ~/.zshrc
source ~/.zshrc

# 配置 Shell(Bash)
echo 'source $(npm root -g)/@zhangchao9527/zz/zz.sh' >> ~/.bashrc
source ~/.bashrc

使用

# 记录当前目录
zz

# 查看历史(分组视图)
zz ls

# 仅看最近 7 天
zz ls --recent

# 兼容 v2.0.0 的平铺视图
zz ls --all

# 快速跳转
zz 0        # 按索引
zz myproj   # 按别名

# 收藏
zz pin
zz pin ~/projects/zz
zz unpin ~/projects/zz

# 别名
zz alias ~/projects/zz z
zz z
zz unalias z

# 清理
zz rm 5
zz rm ~/tmp/scratch
zz purge        # 删已不存在
zz purge 30     # 再多删 30 天未用且 count=1

示例

# 在项目目录中记录路径
cd ~/projects/myapp
zz
# ✓ Recorded: /Users/me/projects/myapp

cd ~/projects/another
zz
# ✓ Recorded: /Users/me/projects/another

# 查看历史
zz ls
# [0] /Users/me/projects/another (2 times)
# [1] /Users/me/projects/myapp (1 times)

# 快速跳转
zz 1
# 跳转到 /Users/me/projects/myapp

项目结构

ZZ/
├── src/
│   ├── index.js      # 主入口
│   ├── db.js         # 数据库操作
│   └── commands.js   # 命令处理
├── zz.sh             # Shell 集成
├── package.json
└── README.md

开发

# 安装依赖
npm install

# 本地测试
node src/index.js

# 配置本地 Shell
echo 'source /path/to/ZZ/zz.sh' >> ~/.zshrc
source ~/.zshrc

许可证

MIT