@mukundkumra/react-component-generator

1.0.2 • Public • Published

React Component Generator

A simple CLI tool for generating React components with a predefined folder structure and boilerplate code.

Features

  • Easily generate React components with a single command.
  • Automatically creates the necessary folder structure.
  • Generates .jsx and .css files with boilerplate code.

Installation

You can either clone the git or install with npm:

  1. Clone the repository:

    git clone https://github.com/mukundkumra/react-component-generator
    cd react-component-generator
    npm link
  2. Install the package:

    npm i -g @mukundkumra/react-component-generator

Usage

To generate a React component, use the command:

gen <ComponentName>

Examples

  1. Generate a simple component:

    gen Home

    This will create the following structure:

    Home/
      ├── Home.jsx
      └── Home.css
    
  2. Generate a nested component:

    gen Test/Home

    This will create the following structure:

    Test/
      └── Home/
          ├── Home.jsx
          └── Home.css
    

Generated File Structure

Home.jsx

import './Home.css';
import React from 'react';

function Home() {
    return (
        <div className="Home">
            {/* Add your JSX here */}
        </div>
    );
}

export default Home;

Home.css

.Home {
    /* Add your styles here */
}

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue for any bugs or feature requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Package Sidebar

Install

npm i @mukundkumra/react-component-generator

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

5.31 kB

Total Files

4

Last publish

Collaborators

  • mukundkumra