# generate-cli-react

> A simple React CLI for generating components.

Latest version **1.1.0** (published 2021-01-31) · ISC license · 0 weekly downloads

## Install

```sh
npm install generate-cli-react
pnpm add generate-cli-react
yarn add generate-cli-react
bun add generate-cli-react
```

Provides the command `generate-react`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2021-01-31 |
| First published | 2021-01-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 22 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Dmytro Ivanishin |
| Maintainers | dimaiv |
| Keywords | generate-react, generate-react-cli, react cli, cli, generate react component, generate component, react component, generate, component, build tools, react |

## Links

- npm: https://www.npmjs.com/package/generate-cli-react
- Repository: https://github.com/dmytroivanishin/generate-react-cli
- Homepage: https://github.com/dmytroivanishin/generate-react-cli#readme
- Issues: https://github.com/dmytroivanishin/generate-react-cli/issues
- npm.io page: https://npm.io/package/generate-cli-react

## Dependencies (3)

- [chalk](https://npm.io/package/chalk.md) ^4.1.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^9.0.1
- [commander](https://npm.io/package/commander.md) ^6.2.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2021-01-31
- 1.0.3 — 2021-01-20
- 1.0.2 — 2021-01-20
- 1.0.0 — 2021-01-16

## README

# Generate React CLI

This tool provides fast creating React components and gets rid of copying, pasting and renaming files.

## Installation

```
  npm install generate-cli-react --save-dev
```

## Usage

This command create a folder with your component within default directory.

```
  npx generate-react component Box
```

You can also generate a few components at once.

```
  npx generate-react component Box Card Button
```

### Example of the component files structure by default:

```
|-- /src
    |-- /components
        |-- /Box
            |-- Box.js
            |-- index.js
```

### Options

You can also overwrite default options.

```
  npx generate-react component Box --withStyle --usePreprocessor scss
```

### Example of the component files structure with options above:

```
|-- /src
    |-- /components
        |-- /Box
            |-- Box.js
            |-- Box.scss
            |-- index.js
```

<table>
  <tr align="left">
    <th>Options</th>
    <th>Description</th>
    <th>Value Type</th>
    <th>Default Value</th>
  </tr>
  <tr align="left">
    <td width="10%">--path</td>
    <td width="50%">The path where you want the component to be generated.</td>
    <td width="20%">String</td>
    <td width="20%">./src/components</td>
  </tr>
  <tr align="left">
    <td width="10%">--withStyle</td>
    <td width="50%">Creates a stylesheet file with this component.</td>
    <td width="20%">Boolean</td>
    <td width="20%">false</td>
  </tr>
  <tr align="left">
    <td width="10%">--useTypescript</td>
    <td width="50%">Creates the typescript component.</td>
    <td width="20%">Boolean</td>
    <td width="20%">false</td>
  </tr>
  <tr align="left">
    <td width="10%">--usePreprocessor</td>
    <td width="50%">Creates a stylesheet file used a preprocessor such as scss with this component.</td>
    <td width="20%">String</td>
    <td width="20%">""</td>
  </tr>
  <tr align="left">
    <td width="10%">--useTest</td>
    <td width="50%">Creates test file with library enzyme or testingLibrary with this component.</td>
    <td width="20%">String</td>
    <td width="20%">""</td>
  </tr>
<table>

---
_Source: https://npm.io/package/generate-cli-react · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
