npm package: @igor.dvlpr/astro-component
Description: 🚀 A CLI tool for bootstrapping Astro components with test-ready scaffolding, render logic, props, slots, and Vitest setup included.  🧪
Author: Igor Dimitrijević
Latest version: 1.1.0

<div align="center">
  <img src="https://raw.githubusercontent.com/igorskyflyer/npm-astro-component/main/assets/astro-component.png" alt="Icon of Astro Component" width="256" height="256">
<h1 align="center">Astro Component</h1>
</div>

<br>

<div align="center">
  🚀 A CLI tool for bootstrapping Astro components with test-ready scaffolding, render logic, props, slots, and Vitest setup included.  🧪
</div>

<br>
<br>

## 📃 Table of Contents

- [Features](#-features)
- [Usage](#-usage)
- [Changelog](#-changelog)
- [Support](#-support)
- [License](#-license)
- [Related](#-related)
- [Author](#-author)

<br>

## 🤖 Features

- ⚡ Instantly scaffolds Astro `.astro` components with prop typing
- 🧪 Generates Vitest-compatible test files with a DOM setup
- 🧩 Supports automatic folder structuring and consistent naming conventions
- 🛠️ Optional flags for dry-run, overwrite protection, and verbose output
- 🌌 Light-weight and zero-config - just run and go

<br>

## 🕵🏼 Usage

Bootstrap Astro components into a target directory with zero config:

```bash
npx "@igor.dvlpr/astro-component" <dest>
```

This will scaffold a test-ready Astro component suite into `<dest>`, complete with:

- 🚀 Component and entrypoint code
- 🧪 Vitest setup
- 🧩 DOM environment
- ⚙️ Render logic
- 📦 Props and slots
- 🧼 Clean file structure

<br>

To preview the generated files without writing anything, use the --dry flag:

```bash
npx "@igor.dvlpr/astro-component" <dest> --dry
```

You'll get a full log of what would be created, ideal for safe inspection before committing.

<br>

## 📝 Changelog

📑 The changelog is available here: [CHANGELOG.md](https://github.com/igorskyflyer/npm-astro-component/blob/main/CHANGELOG.md).

<br>

## 🪪 License

Licensed under the MIT license which is available here, [MIT license](https://github.com/igorskyflyer/npm-astro-component/blob/main/LICENSE.txt).

<br>

## 💖 Support

<div align="center">
  I work hard for every project, including this one and your support means a lot to me!
  <br>
  Consider buying me a coffee. ☕
  <br>
  <br>
  <a href="https://ko-fi.com/igorskyflyer" target="_blank"><img src="https://raw.githubusercontent.com/igorskyflyer/igorskyflyer/main/assets/ko-fi.png" alt="Donate to igorskyflyer" width="180" height="46"></a>
  <br>
  <br>
  <em>Thank you for supporting my efforts!</em> 🙏😊
</div>

<br>

## 🧬 Related

[@igor.dvlpr/windev](https://www.npmjs.com/package/@igor.dvlpr/windev)

> _🍃 Provides ways of checking whether a path is a legacy Windows device. 💾_

<br>

[@igor.dvlpr/astro-post-excerpt](https://www.npmjs.com/package/@igor.dvlpr/astro-post-excerpt)

> _⭐ An Astro component that renders post excerpts for your Astro blog - directly from your Markdown and MDX files. Astro v2+ collections are supported as well! 💎_

<br>

[@igor.dvlpr/astro-escaped-component](https://www.npmjs.com/package/@igor.dvlpr/astro-escaped-component)

> _🏃🏻‍♂️‍➡️ An Astro component that holds only HTML-encoded content. 📜_

<br>

[@igor.dvlpr/pathexists](https://www.npmjs.com/package/@igor.dvlpr/pathexists)

> _🧲 Provides ways of properly checking if a path exists inside a given array of files/directories both on Windows and UNIX-like operating systems. 🗺_

<br>

[@igor.dvlpr/astro-easynav-button](https://www.npmjs.com/package/@igor.dvlpr/astro-easynav-button)

> _🧭 Add an easy-to-use navigational button (jump to top/bottom) to your Astro site. 🔼_

<br>

## 👨🏻‍💻 Author

Created by **Igor Dimitrijević** ([_@igorskyflyer_](https://github.com/igorskyflyer/)).