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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@diekotto/code-digest

v3.1.1

Published

GHA version of the awesome tool gitingest. https://gitingest.com

Readme

Code Digest Generator

GitHub Release Node npm

Coverage

Statements Branches Functions Lines

Npm package

link: @diekotto/code-digest

A comprehensive tool for generating detailed code digests of your codebase, optimized for Large Language Model (LLM) context windows. Perfect for documentation, code analysis, and AI-assisted development.

Features

  • 📊 Provides a concise metadata summary
  • 📝 Generates a detailed digest of your codebase
  • 🌳 Creates a visual directory tree structure
  • 🚀 Fast execution with Node.js
  • 🔒 Secure artifact storage
  • ⚙️ Configurable file ignoring patterns
  • 🔄 Compatible with CI/CD workflows

Usage Options

Option 1: GitHub Action

Add the following step to your GitHub Actions workflow:

- name: Generate Code Digest
  uses: diekotto/code-digest-action@v2
  with:
    directory: 'src'
    output-format: 'text'

Option 2: CLI Tool via NPX

Run directly without installing:

npx @diekotto/code-digest --directory ./src --output ./output

Option 3: Globally Installed CLI

Install globally:

npm install -g @diekotto/code-digest

Then use anywhere:

code-digest --directory ./src --format both

Configuration

GitHub Action Configuration

| Input | Description | Required | Default | | ----------------- | ------------------------------------ | -------- | ---------------------- | | node-version | Node.js version to use | No | '22' | | directory | Directory to analyze | No | '.' | | output-dir | Output directory for generated files | No | 'code-digest-output' | | ignore-patterns | Additional patterns to ignore | No | '' | | gitignore-path | Path to custom .gitignore file | No | '.gitignore' | | max-file-size | Maximum file size in MB | No | '10' | | include-dot | Include dot files in the tree | No | 'false' | | output-format | Output format (json, text, or both) | No | 'text' | | retention-days | Number of days to retain artifacts | No | '90' |

CLI Options

| Option | Alias | Description | Default | | --------------- | ----- | ----------------------------------------------- | ------------------------- | | --directory | -d | Directory to analyze | Current working directory | | --output | -o | Output directory for generated files | code-digest-output | | --ignore | -i | Additional patterns to ignore (comma separated) | - | | --gitignore | - | Path to custom .gitignore file | .gitignore | | --max-size | - | Maximum file size in MB | 10 | | --include-dot | - | Include dot files in the tree | false | | --format | -f | Output format (json, text, or both) | text |

Output Files

The tool generates multiple files with a timestamp in the output directory:

  • metadata-{timestamp}.json: Contains overall statistics and execution information
  • tree-{timestamp}.txt: Text representation of the directory structure (if format includes 'text')
  • tree-{timestamp}.json: JSON representation of the directory structure (if format includes 'json')
  • digest-{timestamp}.txt: Detailed file information in text format (if format includes 'text')
  • digest-{timestamp}.json: Detailed file information in JSON format (if format includes 'json')

Example Workflow

GitHub Actions Workflow

name: Generate Code Digest

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  digest:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Generate Code Digest
        uses: diekotto/code-digest-action@v2
        with:
          directory: 'src'
          output-format: 'both'
          ignore-patterns: 'node_modules,dist,coverage'

      - name: Download Digest Files
        uses: actions/download-artifact@v4
        with:
          name: code-digest-files

CLI Usage Examples

  1. Generate digest for current directory:
npx @diekotto/code-digest
  1. Generate digest for a specific directory with custom output location:
npx @diekotto/code-digest -d ./src -o ./output
  1. Ignore specific patterns and set custom max file size:
npx @diekotto/code-digest -i "*.log,*.tmp" --max-size 5

Use Cases

  • Code Reviews: Provide structured context for pull request reviews
  • Documentation: Generate detailed codebase summaries
  • AI Integration: Create optimized context for LLM-powered development tools
  • Archival: Maintain searchable snapshots of your codebase

Security

This tool:

  • Uses specific versions of dependent actions (when used as a GitHub Action)
  • Runs in an isolated environment
  • Doesn't require any sensitive permissions
  • Stores artifacts securely

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Diego Maroto

Support

If you encounter any problems or have suggestions, please open an issue in the GitHub repository.