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

nostr-git-core

v1.0.0-alpha.1

Published

Nostr-Git is a TypeScript library that bridges **Git** with **Nostr**. It provides helpers to:

Downloads

6

Readme

Nostr-Git

Nostr-Git is a TypeScript library that bridges Git with Nostr. It provides helpers to:

  • Create and parse Git-related Nostr events (NIP-34, plus related NIPs used by the project)
  • Perform Git operations (via isomorphic-git) with vendor/provider abstractions
  • Publish and consume repo announcements, repo state, patches, issues, and status updates
  • Run Git operations in a Web Worker (Comlink) for browser-friendly usage

This repository builds and publishes a single-package npm distribution:

  • Package name: @nostr-git/core

The public API is exposed via top-level exports and subpath exports (see package.json and src/index.ts).

Install

pnpm add @nostr-git/core
# or
npm i @nostr-git/core

Quick start (library)

The root barrel exports namespaced modules:

import * as ngit from "@nostr-git/core"
 
// Example: initialize provider plumbing for Git + Nostr
const git = ngit.api.getGitProvider()

Convenience exports are also available:

import { getGitProvider, initializeNostrGitProvider } from "@nostr-git/core"

Event tag access (required)

Always use the canonical tag helpers when reading event tags. Do not use event.tags.find / event.tags.filter directly.

// Option A: import helpers from the `events` subpath
import { getTag, getTags, getTagValue } from "@nostr-git/core/events"
 
// Option B: use the namespaced root export
// import * as ngit from "@nostr-git/core"
// const { getTag, getTags, getTagValue } = ngit.events
 
const committer = getTag(event, "committer")
const clones = getTags(announcement, "clone")
const repoUrl = getTagValue(announcement, "r")

Worker usage (browser)

Nostr-Git ships a worker bundle export and a Comlink client.

import { getGitWorker, configureWorkerEventIO } from "@nostr-git/core"
import type { EventIO } from "@nostr-git/core"
 
const eventIO: EventIO = {
  fetchEvents: async () => [],
  publishEvent: async (event) => ({ ok: true, relays: [] }),
  publishEvents: async (events) => Promise.all(events.map((e) => eventIO.publishEvent(e))),
  getCurrentPubkey: () => "f".repeat(64),
}
 
const { api, worker } = getGitWorker((evt) => {
  console.log("[worker-progress]", (evt as MessageEvent).data ?? evt)
})
 
await configureWorkerEventIO(api, eventIO)
// ... call worker API methods
worker.terminate()

See examples/worker-usage.ts for a fuller example.

Runtime validation (feature-flagged)

Optional Zod-backed event validation can be toggled via NOSTR_GIT_VALIDATE_EVENTS.

  • Default behavior: enabled when NODE_ENV != "production", disabled in production.
  • Truthy values: true, 1, yes
  • Falsy values: false, 0, no

Development

Prerequisites

Common commands

pnpm install
pnpm build
pnpm test
pnpm lint
pnpm typecheck
pnpm dev

For watch mode (tsc + worker bundle), see pnpm watch and scripts/dev.mjs.

Documentation

License

See LICENSE.