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

@thinkeloquent/github-sdk-git

v0.0.1

Published

GitHub Git API CLI and SDK

Downloads

11

Readme

GitHub Git API CLI/SDK

A Node.js ES module that provides both CLI and SDK functionality for GitHub's Git API.

Installation

cd mjs/git
npm install

Configuration

Set your GitHub token as an environment variable:

export GITHUB_TOKEN=your_github_token_here

Or create a .env file:

GITHUB_TOKEN=your_github_token_here

CLI Usage

Blob Operations

# Create a blob
./cli.mjs blob create -o owner -r repo -c "Hello World"
./cli.mjs blob create -o owner -r repo -f ./file.txt -e base64

# Get a blob
./cli.mjs blob get -o owner -r repo -s sha123456
./cli.mjs blob get -o owner -r repo -s sha123456 --save output.txt

Commit Operations

# Create a commit
./cli.mjs commit create -o owner -r repo -m "Initial commit" -t tree_sha -p parent_sha

# Get a commit
./cli.mjs commit get -o owner -r repo -s commit_sha

Reference Operations

# Create a reference
./cli.mjs ref create -o owner -r repo --ref refs/heads/feature -s sha123456

# Get a reference
./cli.mjs ref get -o owner -r repo --ref heads/main

# List matching references
./cli.mjs ref list -o owner -r repo --ref heads/feature

# Update a reference
./cli.mjs ref update -o owner -r repo --ref heads/main -s new_sha --force

# Delete a reference
./cli.mjs ref delete -o owner -r repo --ref heads/feature

Tag Operations

# Create a tag
./cli.mjs tag create -o owner -r repo -t v1.0.0 -m "Release v1.0.0" --object commit_sha

# Get a tag
./cli.mjs tag get -o owner -r repo -s tag_sha

Tree Operations

# Create a tree
./cli.mjs tree create -o owner -r repo -t '[{"path":"file.txt","mode":"100644","type":"blob","sha":"blob_sha"}]'

# Get a tree
./cli.mjs tree get -o owner -r repo -s tree_sha --recursive

SDK Usage

import { GitHubClient } from './index.mjs';

const client = new GitHubClient({
  token: 'your_token',
  baseUrl: 'https://api.github.com'
});

// Create a blob
const blob = await client.createBlob('owner', 'repo', 'Hello World', 'utf-8');
console.log(blob.sha);

// Get a commit
const commit = await client.getCommit('owner', 'repo', 'commit_sha');
console.log(commit.message);

// Create a reference
const ref = await client.createRef('owner', 'repo', 'refs/heads/feature', 'sha');

// Create a tree
const tree = await client.createTree('owner', 'repo', [
  { path: 'file.txt', mode: '100644', type: 'blob', sha: 'blob_sha' }
]);

API Methods

GitHubClient

  • createBlob(owner, repo, content, encoding)
  • getBlob(owner, repo, fileSha)
  • createCommit(owner, repo, message, tree, parents, author, committer)
  • getCommit(owner, repo, commitSha)
  • createRef(owner, repo, ref, sha)
  • getRef(owner, repo, ref)
  • listMatchingRefs(owner, repo, ref)
  • updateRef(owner, repo, ref, sha, force)
  • deleteRef(owner, repo, ref)
  • createTag(owner, repo, tag, message, object, type, tagger)
  • getTag(owner, repo, tagSha)
  • createTree(owner, repo, tree, baseTree)
  • getTree(owner, repo, treeSha, recursive)

Options

All CLI commands support:

  • --json: Output results as JSON
  • -o, --owner: Repository owner
  • -r, --repo: Repository name

License

MIT