Repo Condenser is a powerful NPM package that consolidates the entire codebase of a repository into a single Markdown file. It's perfect for creating quick overviews, documentation, or backups of your project's code structure.
- Condenses all code files in a repository into a single Markdown file
- Respects
.gitignore
rules - Allows custom folder exclusions via a configuration file
- Ignores hidden files and directories
- Overwrites existing output file to ensure up-to-date content
You can install Repo Condenser globally to use it across all your projects:
npm install -g repo-condenser
Or, install it as a dev dependency in your project:
npm install --save-dev repo-condenser
If installed globally, you can run Repo Condenser from any directory:
repo-condenser
If installed as a project dependency, you can use npx:
npx repo-condenser
You can also use Repo Condenser programmatically in your Node.js projects:
const { condenseRepo } = require("repo-condenser");
condenseRepo()
.then(() => console.log("Repository condensed successfully!"))
.catch((error) => console.error("Error condensing repository:", error));
Repo Condenser uses two main sources for configuration:
Repo Condenser automatically respects your project's .gitignore
file. Any patterns listed in .gitignore
will be excluded from the condensed output.
You can create a condense.config.json
file in your project root to specify additional folders to ignore. Here's an example:
{
"ignoreFolders": ["/build", "/temp", "/logs"]
}
Repo Condenser creates a file named repo_contents.md
in your project root. This file contains the condensed contents of your repository, with each file represented as follows:
# path/to/file.ext
file contents
---
- Binary files are not included in the output
- Very large repositories may result in a large output file
- Symlinks are not followed
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
If you encounter any issues or have questions, please file an issue on the GitHub repository.
We hope Repo Condenser helps you manage and understand your codebase better. Happy coding!