sitemap-content-generator
v1.0.8
Published
Generate folder structure and filtered content from your project files
Downloads
48
Readme
sitemap-content-generator
Description
sitemap-content-generator is a CLI tool that generates a markdown representation of your project's folder structure and creates a filtered JSON file containing the content from your project's main files. It intelligently excludes files and folders that are typically not part of your application's core logic, such as build outputs, library folders, framework files, and specific UI components.
Features
Folder Structure Mapping:
Scans your project directory and creates asitemap.mdfile that represents your project's hierarchical folder structure.Content Extraction:
Reads and extracts content from files, filtering out non-essential files to focus on the project's core logic.Customizable Exclusions:
Excludes common build folders (e.g.,node_modules,build,dist, etc.), configuration files, and specific folders likecomponents/uiby default. These settings can be customized by modifying the corresponding arrays and sets in thecli.jsfile.
Installation
You can install the package globally via npm:
npm install -g sitemap-content-generatorAlternatively, you can use it with npx without a global installation:
npx sitemap-content-generatorUsage
Navigate to Your Project Root:
Open your terminal and change your directory to the root of your project:
cd /path/to/your/projectRun the Command:
Execute the CLI tool with the following command:
sitemapgenWhen executed, the tool will:
- Create a
metadatafolder (if it doesn't already exist) in your project root. - Generate a
sitemap.mdfile that outlines your project's folder structure. - Generate a
filteredContent.jsonfile containing the filtered content extracted from your project's main files.
- Create a
Configuration & Customization
By default, the tool excludes the following:
Folders:
.git,.next,.contentlayer,.github,.husky,.vscode,.yarn,node_modules,api/studio/.sanity,api/studio/dist,build,dist,out,public,vendor,bower_componentsSpecific Relative Folder:
components/ui(and all its contents)Files:
package-lock.json,yarn.lock,package.json,README.md,.gitignore,.env, and other configuration or dependency filesFile Extensions:
.jpeg,.jpg,.png,.svg,.gif,.ico,.mdPaths (Prefixes):
Any path starting with.sanity/,studio/.sanity/runtime/,z-utils/,axelrod-nostr/project/out/, etc.
If you need to customize these exclusion settings, simply edit the respective arrays and sets in the cli.js file of the package.
License
This project is licensed under the MIT License.
Author
zvedov
