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

@phoenix-wing/git-node

v0.6.2

Published

Phoenix Git Node.js CLI、仓库读取与安全历史改写 adapter

Readme

@phoenix-wing/git-node

Node 22 Git adapter:以参数数组运行 Git CLI、读取结构化 commit/ref 状态,并在隔离临时 worktree 中安全合并连续提交。

只读轻量接口(0.6.0 本地候选)

  • pnwReadGitRepositorySummary(startPath, options):返回 canonical root、HEAD、可选 current ref / branch / upstream / remote URL,以及 newest-first 的最新 N 条 PnwGitCommitSummary。默认只读 1 条;仅当 includeRemoteUrl: true 时查询一个 remote URL。
  • pnwReadGitCommitPage(startPath, options):以必填 expectedHeadOid 固定一次浏览会话,使用可选 beforeOid(exclusive)和 limit 读取 first-parent 历史页;返回 commitshasMore,有下一页时返回 nextBeforeOid
  • 两项接口均以一次 NUL 分隔的 git log 批量读取当前页,不逐 commit 启动 cat-file;它们不读取 status、operation marker、全部 remotes、全部 refs 或 remote reachability。
  • 两项 options 均接受 AbortSignal;兼容的 pnwReadGitRepository / pnwAnalyzeGitSquash options 也新增了同名可选字段。底层 pnwRunGitCommand 会终止子进程并以 AbortError 拒绝。

limit / maxCommits 范围为 1..1000。分页游标是同一 expectedHeadOid 下的不透明 OID;HEAD 改变或游标不再可达时必须重新读取 summary,不应把页结果拼接到旧历史。

完整、安全敏感的 pnwReadGitRepositorypnwAnalyzeGitSquashpnwExecuteGitSquashpnwUndoGitSquash 保持原语义。轻量结果不包含 clean、operation、签名、额外 header、remote reachability 或 ref occupancy,禁止用它绕过 squash preflight。

本包不包含 VS Code、Webview 或产品确认 UI。所有历史写入都要求 expected HEAD;共享历史 warning 还要求宿主传入显式 acknowledgement。最终通过 git update-ref <ref> <new> <old> 原子切换,只移动当前本地分支,不 push、不删除或移动 remote/其他分支与标签。备份 ref 使用 create-only 写入,重名时递增编号。