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

@treeport/panel-sdk

v0.3.0

Published

Browser SDK for Treeport web panels.

Readme

@treeport/panel-sdk

Typed browser SDK for Treeport web panels.

Install the SDK as a development dependency for editor and TypeScript support:

pnpm add --save-dev @treeport/panel-sdk

Treeport compiles panel source with its built-in Vite toolchain and resolves @treeport/panel-sdk to the host's runtime copy. Panel modules can therefore import the SDK directly without bundling their own copy, adding an import map, or defining a package-owned build step:

import { treeport } from '@treeport/panel-sdk'

treeport.panel.setTitle('Review route')

const context = await treeport.context()
const diff = await treeport.diff()
const discovery = await treeport.network.listeners()

for (const listener of discovery.listeners) {
  console.log(listener.host, listener.port, listener.command)
}

// The unified patch is the final combined worktree result. Paths can occur in
// more than one set, such as a branch file that was also edited locally.
console.log(diff.unified)
console.log(diff.changeSets.branch)
console.log(diff.changeSets.staged)
console.log(diff.changeSets.unstaged)
console.log(diff.changeSets.untracked)

await treeport.storage.set('drafts', [{ file: 'src/app.ts', line: 12 }])
const drafts = await treeport.storage.get('drafts')

const stopFind = treeport.shortcuts.onFind(() => {
  // Open the panel's own find interface.
})

treeport.panel.setTitle(title) sets a runtime title in the current Treeport client. Pass null to restore the configured title. Treeport does not persist or synchronize runtime titles.

treeport.context() includes the stored JSON launch input and worktree-relative launch directory.

treeport.network.listeners() returns listening TCP sockets conservatively attributed to the panel's worktree by Treeport terminal ancestry or process working directory. Each listener includes its PID, short command, host, port, and a nullable Treeport terminal ID. Processes Treeport cannot access or confidently attribute are omitted. Unsupported platforms return supported: false instead of failing. A listener does not guarantee HTTP and the SDK does not turn it into a routed or proxied URL.

treeport.diff() returns a combined unified patch from the default-branch merge base through the final working-tree state. Its relative file paths are also grouped into changeSets.branch (merge base to HEAD), changeSets.staged (HEAD to index), changeSets.unstaged (index to working tree), and changeSets.untracked. A path can occur in more than one group.

treeport.shortcuts.onFind(handler) delivers Cmd/Ctrl+F whether keyboard focus is inside the panel or elsewhere in the Treeport workspace. It returns an unsubscribe function. Panels own their find interface and behavior; Treeport only routes the generic shortcut.

An HTTP application loaded in the Browser package's nested iframe can use treeport.panel.setTitle(). The Browser package relays this title message. While the target is embedded, the SDK also reports its current URL so the Browser panel can preserve client-side navigation. The target must include the SDK in its own application build. Browser targets cannot use context, diff, network discovery, storage, launch, external URL, shortcuts, or workspace navigation methods.