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
Markdown
# Polymorphic Create README MD
š **A modern TypeScript CLI tool to generate professional README.md files based on your project structure and scripts.**
[](https://www.npmjs.com/package/polymorphic-create-readme-md)
[](https://opensource.org/licenses/ISC)
[](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**