UNPKG

polymorphic-create-readme-md

Version:

A modern TypeScript tool to generate professional README.md files based on your project structure and scripts.

152 lines (114 loc) • 4.29 kB
# Polymorphic Create README MD šŸš€ **A modern TypeScript CLI tool to generate professional README.md files based on your project structure and scripts.** [![npm version](https://img.shields.io/npm/v/polymorphic-create-readme-md.svg)](https://www.npmjs.com/package/polymorphic-create-readme-md) [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC) [![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue.svg)](https://www.typescriptlang.org/) ## šŸ“‹ Table of Contents - [About](#about) - [Features](#features) - [Installation](#installation) - [Usage](#usage) - [Project Structure](#project-structure) - [Configuration](#configuration) - [Templates](#templates) - [Development](#development) - [License](#license) ## šŸŽÆ About **Polymorphic Create README MD** is a powerful command-line tool that automatically analyzes your project structure and generates professional README.md files. The tool supports various package managers (npm, yarn, pnpm, bun) and creates structured documentation with minimal effort. ## ✨ Features - šŸ” **Automatic project structure analysis** - scans files and folders with configurable depth - šŸ“¦ **Package manager detection** - automatically detects npm, yarn, pnpm, or bun - šŸ“ **Script analysis** - extracts and documents all available npm scripts - šŸŽØ **Professional templates** - ready-made templates for beautiful formatting - šŸŽÆ **TypeScript** - written in TypeScript for reliability and type safety - šŸš€ **CLI tool** - easily integrates into your workflow ## šŸ“¦ Installation ### Global Installation ```bash npm install -g polymorphic-create-readme-md ``` ### Local Installation ```bash npm install --save-dev polymorphic-create-readme-md ``` ## šŸš€ Usage ### Global Usage ```bash create-readme ``` ### Local Usage ```bash npx create-readme ``` ### In package.json ```json { "scripts": { "generate-readme": "create-readme" } } ``` Then run: ```bash npm run generate-readme ``` ## āš™ļø Configuration When you run the tool, you'll be prompted to fill in the following fields: - **Project name** - project name (default: current folder name) - **Project description** - project description (default: "A modern web application") - **Repository URL** - repository URL (GitHub, GitLab, Bitbucket, etc.) - **Scan depth** - project structure scan depth (1-10 levels, default: 4) - after scanning you get the structures listed below. *Project Structure* ``` polymorphic-create-readme-md/ ā”œā”€ā”€ src/ │ ā”œā”€ā”€ constants/ │ │ ā”œā”€ā”€ answers.constants.ts │ │ └── index.ts │ ā”œā”€ā”€ helpers/ │ │ ā”œā”€ā”€ get-current-date.ts │ │ └── index.ts │ ā”œā”€ā”€ services/ │ │ ā”œā”€ā”€ scripts-analyzer.service.ts │ │ ā”œā”€ā”€ structure-analyzer.service.ts │ │ ā”œā”€ā”€ template-engine.service.ts │ │ └── index.ts │ ā”œā”€ā”€ templates/ │ │ ā”œā”€ā”€ features.md │ │ ā”œā”€ā”€ footer.md │ │ ā”œā”€ā”€ getting-started.md │ │ ā”œā”€ā”€ header.md │ │ └── scripts.md │ ā”œā”€ā”€ types/ │ │ ā”œā”€ā”€ constants/ │ │ │ └── answers.types.ts │ │ ā”œā”€ā”€ services/ │ │ │ ā”œā”€ā”€ scripts-analyzer.types.ts │ │ │ ā”œā”€ā”€ structure-analyzer.types.ts │ │ │ └── template.engine.types.ts │ │ └── index.ts │ ā”œā”€ā”€ utils/ │ │ ā”œā”€ā”€ analyzers.utils.ts │ │ └── index.ts │ └── index.ts ā”œā”€ā”€ package.json ā”œā”€ā”€ tsconfig.json └── README.md ``` ## šŸ“ Templates The tool uses a modular template system: - **header.md** - header and project structure - **getting-started.md** - installation and setup instructions - **scripts.md** - available scripts documentation - **features.md** - features description - **footer.md** - additional information All templates support variables and conditional logic. ## šŸ¤ Supported Package Managers - **npm** - `npm install` - **yarn** - `yarn install` - **pnpm** - `pnpm install` - **bun** - `bun install` ## šŸ“„ License This project is licensed under the ISC License. ## šŸ‘Øā€šŸ’» Author **suren-polymorphic**