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

@githosted/sdk

v0.1.2

Published

TypeScript SDK for githosted — git-backed storage for AI agents

Readme

@githosted/sdk

TypeScript SDK for githosted — read, write, and diff files in versioned Git repos from Node, browsers, and edge runtimes.

A small, typed surface for the operations you actually do against a repo: read a file, commit a change, list history, diff two refs. Real Git underneath; you're not talking to a custom blob store. Browser, Node, and edge entry points are all included.

Install

npm install @githosted/sdk

Quick start

import { Client } from "@githosted/sdk";

const repo = new Client({ token: "gw_…" }).repo("my-agent");

// Write a file (creates a commit).
await repo.write("output.json", '{"status": "ok"}', {
  message: "Run #42",
});

// Read it back. `content` is the UTF-8-decoded string;
// `rawContent` is the original Uint8Array.
const file = await repo.read("output.json");
console.log(file.content);

// Walk recent history.
for (const commit of await repo.log({ limit: 5 })) {
  console.log(commit.hash.slice(0, 7), commit.subject);
}

// Diff between two refs.
const delta = await repo.diff("HEAD~1", "HEAD");
console.log(delta.patch);

Authentication

Tokens are scoped to a workspace. Mint one at app.githosted.dev → Tokens, then pass it to new Client({ token: … }).

| Token prefix | Scope | |---|---| | gw_… | Read + write | | gr_… | Read-only |

In a browser, use a short-lived token issued by your backend — never embed gw_… in client-side code.

React hooks

import { useRepo, useFile } from "@githosted/sdk/react";

Hooks wrap TanStack Query (peer dep, optional). See docs/sdks/typescript/react.

Entry points

| Import | Use in | |---|---| | @githosted/sdk | auto-resolves Node/browser by environment | | @githosted/sdk/proto | generated protobuf types only | | @githosted/sdk/react | React hooks (useRepo, useFile, …) |

Errors

The SDK throws typed errors you can match on:

import { Client, NotFoundError, RepoBusyError, StaleHeadError } from "@githosted/sdk";

try {
  await repo.read("missing.txt");
} catch (err) {
  if (err instanceof NotFoundError) { /* … */ }
}

RepoBusyError and StaleHeadError are retryable — withRetry() is included for the common backoff loop.

Documentation

License

MIT.