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 🙏

© 2024 – Pkg Stats / Ryan Hefner

cat-save

v1.0.0

Published

Concatenate and save: recursively parse through a repo into a single file

Downloads

4

Readme

cat-s

cat-s (Concatenate and Save) is a command-line tool for generating a summary of a repository, including a file structure sitemap and the content of each file. This tool is useful for quickly sharing code structures or preparing repository overviews.

npm License

Installation

To install cat-s globally, run:

npm install -g cat-s

Usage

cats [options] <repoPath>

Options

  • -o, --output <path>: Specify the output file path (default: "repo_summary.md")
  • -i, --ignore <patterns>: Specify patterns to ignore (comma-separated)
  • -m, --max-file-size <size>: Maximum file size in KB to include (default: 1024)
  • -h, --help: Display help information

Example

To generate a summary of the current directory and save it to repo-summary.md, run:

cats /path/to/your/repo -o summary.md -i node_modules,dist -m 2048

This command will create a summary of the repository located at /path/to/your/repo, save it as summary.md, ignore node_modules and dist directories, and include files up to 2MB in size.

Features

  • Generate a file structure sitemap of the repository
  • Include file contents in the summary
  • Ignore specified patterns (e.g., node_modules, .git)
  • Limit file size for inclusion
  • Customizable output location

Configuration

cat-s uses a configuration file located at ~/.cats/config.json. This file allows you to customize the behavior of the tool. Below are the available configuration options:

useGitignore

  • Type: boolean
  • Default: true
  • Description: Determines whether to respect the .gitignore file when traversing directories. If set to true, files and directories specified in .gitignore will be excluded from the summary.

include

  • Type: array of strings
  • Default: [".js", ".jsx", ".json", ".md", ".sh", ".ts", ".tsx", ".yaml", ".yml", "Dockerfile"]
  • Description: Specifies the file extensions to include in the summary. Only files with these extensions will be processed and included.

exclude

  • Type: array of strings
  • Default: [".env", ".jpg", ".mp4", ".tsbuildinfo", "package-lock.json"]
  • Description: Specifies the file extensions to exclude from the summary. Files with these extensions will be ignored, even if they are listed in the include array.

ignorePaths

  • Type: array of strings
  • Default: [".git", "build", "config", "dist", "node_modules", "pnpm-lock.yaml", "package-lock.json"]
  • Description: Specifies directories or file paths to ignore during traversal. These paths will be skipped entirely, regardless of other settings.

outputDir

  • Type: string
  • Default: "~/Downloads/cats"
  • Description: Specifies the directory where the summary files will be saved. Supports the use of ~ to denote the user's home directory.
{
  "useGitignore": false,
  "include": [".js", ".ts"],
  "exclude": [".log"],
  "ignorePaths": ["node_modules", "dist"],
  "outputDir": "/path/to/custom/output"
}

Explanation:

  • useGitignore: Disabled, so .gitignore rules are not applied.
  • include: Only .js and .ts files are included.
  • exclude: .log files are excluded.
  • ignorePaths: node_modules and dist directories are ignored.
  • outputDir: Summary files will be saved to /path/to/custom/output.

Contributing

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

License

This project is licensed under the MIT License.