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

@sulthonzh/git-ignore-gen

v1.1.0

Published

Interactive CLI that scans your project for untracked files and suggests .gitignore patterns based on actual project state

Readme

git-ignore-gen

Interactive CLI that scans your project for untracked files and suggests .gitignore patterns based on actual project state.

Features

  • Project-aware scanning: Analyzes git status to identify untracked files
  • Smart pattern detection: Suggests ignore rules based on file extensions, naming patterns, and directory structures
  • Interactive selection: Presents detected patterns with explanations and allows selective inclusion
  • High confidence matching: Uses pattern recognition with confidence scoring
  • Category grouping: Organizes patterns by type (dependencies, build, logs, system, etc.)
  • Safe operations: Supports dry-run mode and update mode to preserve existing .gitignore
  • Enhanced pattern support: Now includes patterns for Python, Java, IDE files, and more frameworks

Installation

npm install -g git-ignore-gen

Or run directly with npx:

npx git-ignore-gen

Usage

Basic Usage

Scan your current directory and show suggested patterns:

git-ignore-gen

Interactive Mode

Select which patterns to include interactively:

git-ignore-gen --interactive

Update Existing .gitignore

Add new patterns to an existing .gitignore file:

git-ignore-gen --update

Dry Run

Preview suggestions without writing files:

git-ignore-gen --dry-run

Custom Path

Scan a specific repository:

git-ignore-gen --path /path/to/repo

Example Output

🔍 Checking git repository...
✓ Git repository detected
✓ Found 15 untracked files
✓ Detected 6 potential patterns

📋 Detected Patterns:

  node_modules/
    Node.js dependencies directory
    Confidence: [██████████] 95%
    Examples: node_modules/lodash/, node_modules/react/

  *.log
    Log files
    Confidence: [████████░░] 85%
    Examples: error.log, debug.log

  dist/
    Distribution build directory
    Confidence: [████████░░] 88%
    Examples: dist/bundle.js, dist/index.html

✅ Added 6 patterns to .gitignore

How It Works

  1. Scans git status: Reads untracked files from your repository
  2. Detects patterns: Matches files against common ignore patterns
  3. Scores confidence: Ranks patterns based on match frequency
  4. Generates .gitignore: Creates organized, commented .gitignore file

Supported Patterns

The tool recognizes common patterns for:

  • Dependencies: node_modules/, vendor/, venv/, .venv/
  • Build artifacts: dist/, build/, .next/, .nuxt/, target/, __pycache__/, *.pyc
  • Logs: *.log, npm-debug.log*, yarn-debug.log*, yarn-error.log*
  • System files: .DS_Store, Thumbs.db, .idea/, .vscode/
  • Config: .env.local
  • Test coverage: coverage/
  • Cache: .cache/
  • IDE files: IntelliJ IDEA, VS Code, Sublime Text project files
  • Python: Virtual environments, bytecode cache, compiled files
  • Java: Gradle build system files
  • Web frameworks: Next.js, Nuxt.js, Jekyll, SASS

Options

Usage: git-ignore-gen [options]

Options:
  -i, --interactive  Interactive mode with pattern selection
  -u, --update       Update existing .gitignore instead of overwriting
  -d, --dry-run      Show suggestions without writing files
  -p, --path <path>  Path to git repository (default: current directory)
  -h, --help         Display help
  -V, --version      Display version

Use Cases

  • New projects: Quickly create comprehensive .gitignore files
  • Forgotten patterns: Detect files that should have been ignored
  • Code review: Ensure proper git hygiene before commits
  • Template augmentation: Enhance existing .gitignore with project-specific patterns

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT

Author

sulthonzh