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

@git-stunts/plumbing

v2.8.0

Published

Robust async, stream-first Git plumbing for Node, Bun, and Deno.

Readme

@git-stunts/plumbing

npm version npm downloads CI license

A low-level, robust, and environment-agnostic Git plumbing library for the modern JavaScript ecosystem. Built with Hexagonal Architecture and Domain-Driven Design (DDD), it provides a secure, streaming-first, and type-safe interface for Git operations across Node.js, Bun, and Deno.

🪠 Key Features

  • Streaming-First Architecture: Unified "Streaming Only" pattern across all runtimes for consistent, memory-efficient data handling.
  • Multi-Runtime Support: Native adapters for Node.js, Bun, and Deno with automatic environment detection.
  • Robust Schema Validation: Powered by Zod, ensuring every Entity and Value Object is valid before use.
  • Hexagonal Architecture: Strict separation between core domain logic and infrastructure adapters.
  • Dependency Injection: Core services like CommandSanitizer and ExecutionOrchestrator are injectable for maximum testability.
  • Hardened Security: Integrated CommandSanitizer and EnvironmentPolicy to prevent argument injection and environment leakage.
  • OOM Protection: Integrated safety buffering (GitStream.collect) with configurable byte limits.
  • Dockerized CI: Parallel test execution across all runtimes using isolated containers.

🛡️ Safety First: Docker Execution

This library performs low-level Git manipulations. To protect your host system and ensure a reproducible environment, execution on the host is strictly prohibited.

All tests and commands should be run inside the provided Docker containers:

docker-compose run --rm node-test

The system will automatically fail if GIT_STUNTS_DOCKER=1 is not set.

We load @git-stunts/docker-guard (v0.1.0+) before every suite (test/support/ensure-docker.js), so invoking ensureDocker() happens automatically for Vitest/Bun/Deno. You can copy the same pattern in other packages:

import { ensureDocker } from '@git-stunts/docker-guard';

ensureDocker();

🏗️ Design Principles

  1. Git as a Subsystem: Git is treated as an external, untrusted dependency. Every command and environment variable is sanitized.
  2. Streaming-First: Buffering is a choice, not a requirement. All data flows through streams to ensure scalability.
  3. Domain Purity: Core logic is 100% environment-agnostic. Runtimes are handled by decoupled adapters.
  4. Security by Default: Prohibits dangerous global flags and restricts the environment to minimize the attack surface.

📋 Prerequisites & Compatibility

  • System Git: Requires Git >= 2.30.0.
  • Runtimes:
    • Node.js: >= 20.0.0
    • Bun: >= 1.3.5
    • Deno: >= 2.0.0

📦 Installation

npm install @git-stunts/plumbing

🛠️ Usage

Zero-Config Initialization

import GitPlumbing from '@git-stunts/plumbing';

// Get a high-level service in one line
// GitRepositoryService is a convenience facade built on plumbing primitives.
const git = GitPlumbing.createRepository({ cwd: './my-repo' });

⚡ Killer Example: Atomic Commit from Scratch

Orchestrate a full commit sequence—from hashing blobs to updating references—with built-in concurrency protection.

import GitPlumbing, { GitSha } from '@git-stunts/plumbing';

const git = GitPlumbing.createRepository({ cwd: './my-repo' });

const commitSha = await git.createCommitFromFiles({
  branch: 'refs/heads/main',
  message: 'Feat: atomic plumbing commit',
  author: { name: 'James Ross', email: '[email protected]' },
  committer: { name: 'James Ross', email: '[email protected]' },
  parents: [GitSha.from(await git.revParse({ revision: 'HEAD' }))],
  files: [
    { path: 'hello.txt', content: 'Hello World' },
    { path: 'script.sh', content: '#!/bin/sh\necho hi', mode: '100755' }
  ],
  concurrency: 10 // Parallelize blob creation safely
});

Core Entities

import { GitSha } from '@git-stunts/plumbing/sha';
import { GitRef } from '@git-stunts/plumbing/ref';
import { GitSignature } from '@git-stunts/plumbing/signature';

// Validate and normalize (throws ValidationError if invalid)
const sha = GitSha.from('a1b2c3d4...');
const mainBranch = GitRef.branch('main');

📖 Documentation

🧪 Testing

npm test          # Multi-runtime Docker tests
npm run test:local # Local vitest run

📄 License

Apache-2.0