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

github101

v1.0.1

Published

A tool for analyzing Git repositories

Readme

GitHub101

A tool for analyzing Git repository code, supporting dependency analysis, file tree generation and other features.

Main Features

  • Support code analysis from GitHub URL or local directory
  • Analyze project file dependencies based on given entry points, scan relevant files as needed
  • Generate project metadata (token consumption estimate, file size, file type)
  • Generate project file tree structure
  • Generate tree structure with file sizes and source code
  • Support file filtering and size limits

Workflow

  1. Code Retrieval

    • Support cloning from GitHub URL
    • Support specifying local directory
    • Support custom domain mapping to GitHub
  2. File Scanning

    • Recursively scan directory structure
    • Filter binary files
    • Support file size limits
    • Support custom file include/exclude rules
  3. Dependency Analysis

    • Analyze import/require statements
    • Build dependency graph
    • Support relative path resolution
    • Support multiple file extensions
  4. Result Generation

    • Generate file tree structure
    • Calculate code metrics and file sizes
    • Generate project metadata
    • Output complete analysis report

Usage Example

import { GitIngest } from "github101";

// Create instance
const gitIngest = new GitIngest({
  tempDir: "temp",
  defaultMaxFileSize: 1024 * 1024, // 1MB
  defaultPatterns: {
    include: ["**/*"],
    exclude: ["**/node_modules/**"],
  },
});

// Analyze from GitHub URL
const result = await gitIngest.analyzeFromUrl(
  "https://github.com/username/repo",
  {
    branch: "main",
    targetPaths: ["src/"],
  }
);

// Analyze from local directory
const result = await gitIngest.analyzeFromDirectory("./my-project", {
  maxFileSize: 2 * 1024 * 1024,
  includePatterns: ["src/**/*.ts"],
});

// Analysis results
console.log(result.metadata); // Project metadata
console.log(result.fileTree); // File tree structure
console.log(result.sizeTree); // File size tree
console.log(result.totalCode); // Total code content

Configuration Options

GitIngestConfig

interface GitIngestConfig {
  tempDir?: string; // Temporary directory
  defaultMaxFileSize?: number; // Maximum file size
  defaultPatterns?: {
    include?: string[]; // File patterns to include
    exclude?: string[]; // File patterns to exclude
  };
  keepTempFiles?: boolean; // Whether to keep temporary files
  customDomainMap?: {
    // Custom domain mapping
    targetDomain: string;
    originalDomain: string;
  };
}

AnalyzeOptions

interface AnalyzeOptions {
  maxFileSize?: number; // Maximum size per file
  includePatterns?: string[]; // File patterns to include
  excludePatterns?: string[]; // File patterns to exclude
  targetPaths?: string[]; // Target file paths
  branch?: string; // Git branch
  commit?: string; // Git commit
}

Installation

npm install github101

License

MIT