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

@treenwang/gitkit

v0.1.3

Published

Embeddable server-side git operations with sparse checkout, worktree-isolated concurrency, structured conflict resolution, and optional GitHub PR integration.

Readme

@treenwang/gitkit

An embeddable package for operating on Git repositories from a server: check out only the directories you name, safe under concurrency, conflicts returned as structured data, with optional GitHub pull requests.

What it solves

  • You need docs/ out of a repository and do not want to pull the whole thing down: partial clone plus cone-mode sparse checkout.
  • Your server handles several tasks against one repository at once: one git worktree per task, sharing an object database, none of them interfering.
  • Someone else may push from another client at any moment: a rejected push and a merge conflict are return values, not exceptions.
  • The target branch is protected: the main path is fixed as create a branch, edit, commit, push, open a pull request.

Requirements

  • Node.js >= 18
  • git >= 2.32 on the host; the worktree and sparse-checkout combination is defective in earlier versions
  • The workspace on local disk or a Kubernetes PV, owned by a single process - several processes may not share one root
  • HTTPS personal access token authentication
  • Pull requests need @octokit/rest, an optional peerDependency. Without it the core git features are unaffected.

Install

npm install @treenwang/gitkit
# only if you want pull requests
npm install @octokit/rest

Quick start

import { RepoManager } from '@treenwang/gitkit'

const manager = new RepoManager({
  root: '/data/repos',
  auth: { token: process.env.GH_TOKEN! },
})

const store = await manager.store({
  url: 'https://github.com/acme/web',
  github: {},                        // enables pull requests, reusing the token above
})

const result = await store.publish({
  branch: 'feat/docs-update',
  sparsePaths: [
    { path: 'docs', requireChecks: false },   // docs can merge straight away
    { path: 'src', requireChecks: true },     // code has to wait for CI
  ],
  author: { name: 'Bot', email: '[email protected]' },
  message: 'docs: update getting started',
  files: [{ path: 'docs/getting-started.md', content: '# Hello\n' }],
  createPR: { title: 'Update docs', base: 'main' },
  merge: 'auto',
})

Security

  • The token is never written into the URL, where it would land in .git/config and the reflog. It is injected per invocation with -c http.extraheader.
  • The token never appears in logs, error messages or the command field; it is always scrubbed to ***.
  • File access goes through PathGuard, which refuses directory traversal, access to .git, and anything outside the sparse range, then re-checks with realpath immediately before reading or writing to close the symlink escape.

Related packages

| Package | Environment | Responsibility | | --- | --- | --- | | @treenwang/gitkit-server | server | HTTP transport: a web-standard handler plus an Express adapter | | @treenwang/gitkit-client | browser | Typed RPC client, zero runtime dependencies | | @treenwang/gitkit-ui | browser | React hooks and components |

The core concepts - the three layers, the concurrency model, the push state machine, conflict handling, session lifecycle and error handling - are covered in the repository's README and in docs/superpowers/specs/.

License

MIT