# react-ct

> A package to generate react component files through the CLI, similar to the way Angular does things

Latest version **1.0.2** (published 2022-03-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-ct
pnpm add react-ct
yarn add react-ct
bun add react-ct
```

Provides the command `rct`.

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-03-17 |
| First published | 2022-03-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Chwunny |
| Maintainers | chwunny |
| Keywords | React CLI, react ct |

## Links

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

## Dependencies (3)

- [chalk](https://npm.io/package/chalk.md) ^4.1.2
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [commander](https://npm.io/package/commander.md) ^9.0.0

## Recent versions

- 1.0.2 (latest) — 2022-03-17
- 1.0.1 — 2022-03-17
- 1.0.0 — 2022-03-15

## README

# react-cli-tool
react-cli-tool is a TypeScript CLI tool for creating react component boilerplate

Note: Please install this package globally for best compatibility  
`npm i -g react-ct` 

<br>

## Example usage


`rct -gc componentName`  

<br>

If you would like to generate a component further down in the file hierarchy just pass prefix the name of your component with the file path  
Example: `rct -gc Components/HomePage/componentName`  
<br>

## Output


<span style="color:green; text-decoration:underline;">CREATE</span> /Users/user/Desktop/directory/app/src/ComponentName/index.tsx  
<span style="color:green; text-decoration:underline;">CREATE</span> /Users/user/Desktop/directory/app/src/ComponentName/ComponentName.tsx  
<span style="color:green; text-decoration:underline;">CREATE</span> /Users/user/Desktop/directory/app/src/ComponentName/ComponentName.tsx

<br>

_src/ComponentName/index.tsx_

```ts
export { default } from './ComponentName';
```

_src/ComponentName/ComponentName.tsx_

```ts
import React from 'react';
import './ComponentName.scss';

const ComponentName = () => {
  return <div className="component-name">ComponentName</div>;
};

export default ComponentName;
```

_src/ComponentName/ComponentName.scss_

```css
.component-name {
}
```

<br>

## Options

-v, --version : Returns currently installed version of react-ct

-gc, --generate-component `"componentName"` : Generates component directory and corresponding files, converts given name to camelCase

<br>

## To Do:

- Implement compatibility for non TypeScript projects
- Option to generate classical components instead of hooks
- Option to ignore the default component naming convention

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