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

@titah/extension-diff

v0.2.0

Published

Editor-style git diff panel for Titah — line numbers, colours, and block-a-range-into-the-prompt.

Readme

titah-extension-diff

Editor-style git diff panel for Titah. Line numbers, colours, and — the point of it — block a range of lines and send it to the main prompt.

Requires Titah with extension API ^0.5.0.

What it looks like

─ src/core/agent.ts ─────────────────────────────────
        ⋯ 4
  4  4      return load()
  5  5    }
  6  6
     7 ▌+ export function summarize(sep) {
     8 ▌+   return turns().map((t) => t.text).join(sep)
›    9 ▌+ }
    10  +
  7 11    export function count() {

VISUAL 3 lines · y send · v cancel

Press y and your prompt becomes @src/core/agent.ts:7-9 , with the cursor right after it. Type "add a doc comment for this function" and send.

Why a reference and not the diff text

What lands in the prompt is the address, not the code. The agent reads the file itself with the tools it already has, so blocking a hundred lines costs the same as blocking three — and the agent sees the file as it is now, not a snapshot that goes stale the moment anything else edits it.

Features

  • Unified diff against HEAD — everything that differs from the last commit, staged or not, each hunk exactly once.
  • Gutter with old/new line numbers, additions green, deletions red, file headers as section rules. The gutter hides itself on narrow panels: at the default 20-column width it would leave no room for the code. Widen with + and it comes back.
  • Visual selectionv to anchor, ↑↓ to extend, y to send. y without a selection sends the line under the cursor.
  • Click to move the cursor, and to extend a selection while visual mode is on.
  • Refresh: r, plus automatic refresh on prompt send, turn end, and panel open.

Installation

{
  "extension": {
    "@titah/extension-diff": {
      "side": "right",
      "key": "<leader>d",
      "options": {
        "gitDiffLimit": 200,
        "contextLines": 3,
        "showWhitespace": false
      }
    }
  },
  // Worth widening: the gutter needs the room, and the default is 20.
  "panel": { "right": { "width": 64 } }
}

Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | gitDiffLimit | number | 200 | Maximum diff lines to read | | contextLines | number | 3 | Context lines for git diff -U | | showWhitespace | boolean | false | false passes --ignore-space-change |

Keybindings

| Key | Action | |-----|--------| | / | Move the cursor; extend the selection when visual mode is on | | v | Start a selection, or cancel the one you have | | y | Send the selection (or the cursor line) to the prompt | | r | Manual refresh |

Esc is not a cancel key here — Titah intercepts it to release panel focus, so it never reaches the panel. v cancels instead. +, - and = are likewise reserved by Titah, for panel width.

Known limits

  • Untracked files don't appear. git diff doesn't see them, and rendering a whole new file as one giant hunk would push every other change past gitDiffLimit.
  • A selection is dropped when the diff itself changes. The panel refreshes at the end of every agent turn, and a selection anchored to lines that have since moved would send a reference to the wrong place — silently, which is worse than losing the selection.
  • No syntax highlighting. A panel row carries one colour for the whole line; per-token colour would need spans in the host contract.

Development

npm install
npm run build
npm test

License

Apache-2.0